fix: passing headers

This commit is contained in:
Michael Zetterberg
2024-05-20 10:21:22 +02:00
parent d9ca0d7b52
commit 6d85bb5887
4 changed files with 26 additions and 16 deletions
-8
View File
@@ -43,14 +43,6 @@ export const middleware: NextMiddleware = async (request, event) => {
if (_continue) {
continue
}
// We use x-lang as either Akamai or Netlify use x-language as the users preferred language
result?.headers.set("x-lang", lang)
result?.headers.set(
"x-pathname",
request.nextUrl.pathname.replace(`/${lang}`, "")
)
result?.headers.set("x-url", request.nextUrl.href)
return result
}
}