Initial Mebbling hub implementation

This commit is contained in:
2026-07-19 00:29:30 +08:00
commit e6ebdb0576
41 changed files with 2571 additions and 0 deletions
+6
View File
@@ -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}`);
}