Initial Mebbling hub implementation
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
export function externalUrl(request: Request, pathname: string) {
|
||||
const current = new URL(request.url);
|
||||
const host = request.headers.get("x-forwarded-host") || request.headers.get("host") || current.host;
|
||||
const protocol = request.headers.get("x-forwarded-proto") || current.protocol.replace(":", "");
|
||||
return new URL(pathname, `${protocol}://${host}`);
|
||||
}
|
||||
Reference in New Issue
Block a user