We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 811bdc0 commit 8a8f9cdCopy full SHA for 8a8f9cd
packages/open-next/src/core/routing/middleware.ts
@@ -54,9 +54,11 @@ export async function handleMiddleware(
54
// We bypass the middleware if the request is internal
55
if (internalEvent.headers["x-isr"]) return internalEvent;
56
57
+ const protocol = new URL(internalEvent.url).protocol;
58
const host = internalEvent.headers.host
- ? `https://${internalEvent.headers.host}`
59
+ ? `${protocol}//${internalEvent.headers.host}`
60
: "http://localhost:3000";
61
+
62
const initialUrl = new URL(normalizedPath, host);
63
initialUrl.search = convertToQueryString(query);
64
const url = initialUrl.toString();
0 commit comments