Skip to content

Commit

Permalink
Fixes edge middleware calling nested routes (#10215)
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored Feb 23, 2024
1 parent 459f74b commit a013182
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/popular-turtles-sort.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@astrojs/vercel": patch
---

Fixes edge middleware calling nested routes
2 changes: 1 addition & 1 deletion packages/integrations/vercel/src/serverless/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default async function middleware(request, context) {
ctx.locals = ${handlerTemplateCall};
const { origin } = new URL(request.url);
const next = () =>
fetch(new URL('${NODE_PATH}', request.url), {
fetch(new URL('/${NODE_PATH}', request.url), {
headers: {
...Object.fromEntries(request.headers.entries()),
'${ASTRO_MIDDLEWARE_SECRET_HEADER}': '${middlewareSecret}',
Expand Down

0 comments on commit a013182

Please sign in to comment.