0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

Fixes edge middleware calling nested routes (#10215)

This commit is contained in:
Matthew Phillips 2024-02-23 09:13:10 -05:00 committed by GitHub
parent 459f74bc71
commit a013182d32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View file

@ -0,0 +1,5 @@
---
"@astrojs/vercel": patch
---
Fixes edge middleware calling nested routes

View file

@ -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}',