mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-21 05:28:30 +00:00
fallback to https
This commit is contained in:
@@ -111,8 +111,7 @@ export function getServiceUrlFromHeaders(headers: ReadonlyHeaders): {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export function constructUrl(request: NextRequest, path: string) {
|
export function constructUrl(request: NextRequest, path: string) {
|
||||||
const forwardedProto =
|
const forwardedProto = request.headers.get("x-forwarded-proto") ?? "https";
|
||||||
request.headers.get("x-forwarded-proto") ?? request.nextUrl.protocol;
|
|
||||||
|
|
||||||
const forwardedHost =
|
const forwardedHost =
|
||||||
request.headers.get("x-zitadel-forward-host") ??
|
request.headers.get("x-zitadel-forward-host") ??
|
||||||
@@ -124,6 +123,6 @@ export function constructUrl(request: NextRequest, path: string) {
|
|||||||
// keep this check to allow localhost for local development
|
// keep this check to allow localhost for local development
|
||||||
forwardedHost?.startsWith("http")
|
forwardedHost?.startsWith("http")
|
||||||
? forwardedHost
|
? forwardedHost
|
||||||
: `${forwardedProto}//${forwardedHost}`,
|
: `${forwardedProto}://${forwardedHost}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user