Skip to content

Commit

Permalink
fix: host not in route handler url when using external middleware (#694)
Browse files Browse the repository at this point in the history
  • Loading branch information
james-elicx authored Jan 10, 2025
1 parent e708ec4 commit 6884444
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/little-geese-study.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@opennextjs/aws': patch
---

Mark the host header as trusted when the OpenNext project has external middleware to align with normal behavior for the Next.js server.
3 changes: 1 addition & 2 deletions packages/open-next/src/build/createServerBundle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,7 @@ async function generateBundle(
target: /core(\/|\\)util\.js/g,
deletes: [
...(disableNextPrebundledReact ? ["requireHooks"] : []),
...(disableRouting ? ["trustHostHeader"] : []),
...(!isBefore13413 ? ["requestHandlerHost"] : []),
...(isBefore13413 ? ["trustHostHeader"] : ["requestHandlerHost"]),
...(isAfter141
? ["experimentalIncrementalCacheHandler"]
: ["stableIncrementalCache"]),
Expand Down

0 comments on commit 6884444

Please sign in to comment.