Fixed origin

This commit is contained in:
2026-02-14 23:07:55 +01:00
parent 137d263060
commit 694652dccd
+2 -2
View File
@@ -4,8 +4,8 @@ import { headers } from "next/headers";
export async function getOrigin(): Promise<{ protocol: string; host: string }> { export async function getOrigin(): Promise<{ protocol: string; host: string }> {
const h = await headers(); const h = await headers();
const host = h.get("host") || "localhost:3000"; const host = process.env.ORIGIN || h.get(":authority") || "localhost:3000";
const protocol = h.get("x-forwarded-proto") ?? "https"; const protocol = h.get("x-forwarded-proto") || h.get(":scheme") || "https";
return { protocol, host }; return { protocol, host };
} }