mirror of
https://github.com/hanzoai/next.js.git
synced 2026-10-30 14:46:38 +00:00
It looks like the `content-length` header can't be ignored for the request forwarded to the render worker. See https://github.com/nodejs/node/issues/27880. Closes #48096, closes #49310. Fix NEXT-1194 fix NEXT-1114
25 lines
617 B
TypeScript
25 lines
617 B
TypeScript
import type { NextRequest } from 'next/server'
|
|
import { withRequestMeta } from '../../../../helpers'
|
|
|
|
export async function POST(request: NextRequest) {
|
|
const body = await request.json()
|
|
return new Response('hello, world', {
|
|
status: 200,
|
|
headers: withRequestMeta({ body }),
|
|
})
|
|
}
|
|
|
|
export async function DELETE(request: NextRequest) {
|
|
const body = await request.json()
|
|
return new Response('delete ' + body.name, {
|
|
status: 200,
|
|
})
|
|
}
|
|
|
|
export async function OPTIONS(request: NextRequest) {
|
|
const body = await request.json()
|
|
return new Response('options ' + body.name, {
|
|
status: 200,
|
|
})
|
|
}
|