diff --git a/packages/next/server/web/spec-extension/response.ts b/packages/next/server/web/spec-extension/response.ts index c34ba8a1df566ed..a440d48798c60e0 100644 --- a/packages/next/server/web/spec-extension/response.ts +++ b/packages/next/server/web/spec-extension/response.ts @@ -67,10 +67,10 @@ export class NextResponse extends Response { return this.cookie(name, '', { expires: new Date(1), path: '/', ...opts }) } - static json(body: any) { + static json(body: any, init?: ResponseInit) { return new NextResponse(JSON.stringify(body), { headers: { 'content-type': 'application/json' }, - }) + }, init) } static redirect(url: string | NextURL | URL, status = 307) {