Unverified Commit 1d3ffea6 authored by JJ Kasper's avatar JJ Kasper Committed by GitHub

Ensure host is in allowed headers (#72867)

The host header is necessary for determining the current domain locale
for ISR so we need to ensure it's in the default allowed headers list.
Without this header we aren't able to render links accurately during
revalidations.


x-ref: https://github.com/vercel/next.js/issues/71848
x-ref: NEXT-3842
parent 64271354
......@@ -316,6 +316,7 @@ export interface DynamicSsgRoute {
* this includes both headers used by the pages and app routers.
*/
const ALLOWED_HEADERS: string[] = [
'host',
MATCHED_PATH_HEADER,
PRERENDER_REVALIDATE_HEADER,
PRERENDER_REVALIDATE_ONLY_GENERATED_HEADER,
......
......@@ -94,6 +94,7 @@ describe('Prerender', () => {
}
const allowHeader = [
'host',
'x-matched-path',
'x-prerender-revalidate',
'x-prerender-revalidate-if-generated',
......
......@@ -68,6 +68,7 @@ const runTests = (isDev) => {
)
expect(data.routes['/404']).toEqual({
allowHeader: [
'host',
'x-matched-path',
'x-prerender-revalidate',
'x-prerender-revalidate-if-generated',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment