core/apps/webapp/app/utils/requestUrl.server.ts
Harshith Mullapudi 8312cc342d Feat: ingest api
2025-06-04 15:03:14 +05:30

11 lines
291 B
TypeScript

// Updates the protocol of the request url to match the request.headers x-forwarded-proto
export function requestUrl(request: Request): URL {
const url = new URL(request.url);
if (request.headers.get("x-forwarded-proto") === "https") {
url.protocol = "https:";
}
return url;
}