Skip to content

Commit 6884444

Browse files
authored
fix: host not in route handler url when using external middleware (#694)
1 parent e708ec4 commit 6884444

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.changeset/little-geese-study.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@opennextjs/aws': patch
3+
---
4+
5+
Mark the host header as trusted when the OpenNext project has external middleware to align with normal behavior for the Next.js server.

packages/open-next/src/build/createServerBundle.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,7 @@ async function generateBundle(
196196
target: /core(\/|\\)util\.js/g,
197197
deletes: [
198198
...(disableNextPrebundledReact ? ["requireHooks"] : []),
199-
...(disableRouting ? ["trustHostHeader"] : []),
200-
...(!isBefore13413 ? ["requestHandlerHost"] : []),
199+
...(isBefore13413 ? ["trustHostHeader"] : ["requestHandlerHost"]),
201200
...(isAfter141
202201
? ["experimentalIncrementalCacheHandler"]
203202
: ["stableIncrementalCache"]),

0 commit comments

Comments
 (0)