Skip to content

Commit 71ed888

Browse files
committed
fix: headers need to be Node.js style plain object (even though Next types allow Headers object)
1 parent 74e2502 commit 71ed888

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

edge-runtime/lib/next-request.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@ import type { NextConfig } from 'next/dist/server/config-shared'
1313
import type { NextRequest, RequestInit } from 'next/dist/server/web/spec-extension/request.js'
1414

1515
export type NetlifyNextRequest = RequestInit &
16-
Pick<NextRequest, 'url' | 'headers' | 'geo' | 'ip' | 'method' | 'body'>
16+
Pick<NextRequest, 'url' | 'geo' | 'ip' | 'method' | 'body'> & {
17+
headers: HeadersInit
18+
}
1719

1820
const normalizeRequest = (url: URL, nextConfig?: NextConfig): URL => {
1921
url.pathname = removeBasePath(url.pathname, nextConfig?.basePath)
@@ -68,7 +70,7 @@ export const buildNextRequest = (
6870

6971
return {
7072
url: normalizedUrl.toString(),
71-
headers,
73+
headers: Object.fromEntries(headers.entries()),
7274
geo: {
7375
city,
7476
country: country?.code,

0 commit comments

Comments
 (0)