Skip to content

Commit cafa816

Browse files
committed
fix: update base hostname to be used from the header instead of using nextUrl host
GitOrigin-RevId: 5c13b6234926b758176c783f076ff4a944061df5
1 parent f1aad17 commit cafa816

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/nextjs/src/middleware/middleware.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,11 @@ export async function proxyRequest(
4848
return NextResponse.next()
4949
}
5050

51+
const appBaseHost = request.headers.get("host")
52+
5153
const matchBaseUrl = new URL(orySdkUrl())
52-
const selfUrl = request.nextUrl.protocol + "//" + request.nextUrl.host
54+
const selfUrl =
55+
request.nextUrl.protocol + "//" + (appBaseHost || request.nextUrl.host)
5356

5457
const upstreamUrl = request.nextUrl.clone()
5558
upstreamUrl.hostname = matchBaseUrl.hostname

0 commit comments

Comments
 (0)