From 0e1727d66717b4862a41c63fd0e11f6e1f467307 Mon Sep 17 00:00:00 2001 From: fflorent Date: Tue, 26 Nov 2024 16:29:19 +0100 Subject: [PATCH] Remove scary changes --- app/server/lib/requestUtils.ts | 2 +- app/server/lib/sendAppPage.ts | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/server/lib/requestUtils.ts b/app/server/lib/requestUtils.ts index f171c58c04..874b712f50 100644 --- a/app/server/lib/requestUtils.ts +++ b/app/server/lib/requestUtils.ts @@ -40,7 +40,7 @@ export function adaptServerUrl(url: URL, req: RequestWithOrg): void { const reqBaseDomain = parseSubdomain(req.hostname).base; if (process.env.GRIST_SERVE_SAME_ORIGIN === 'true' || req.isCustomHost) { - url.host = req.headers.host || req.hostname; + url.hostname = req.hostname; } else if (reqBaseDomain) { const subdomain: string|undefined = parseSubdomain(url.hostname).org || DEFAULT_HOME_SUBDOMAIN; url.hostname = `${subdomain}${reqBaseDomain}`; diff --git a/app/server/lib/sendAppPage.ts b/app/server/lib/sendAppPage.ts index c9efdf7106..81b744dc1e 100644 --- a/app/server/lib/sendAppPage.ts +++ b/app/server/lib/sendAppPage.ts @@ -172,9 +172,9 @@ export function makeSendAppPage({ server, staticDir, tag, testLogin, baseDomain const tagManagerSnippet = needTagManager ? getTagManagerSnippet(process.env.GOOGLE_TAG_MANAGER_ID) : ''; const staticTag = options.tag || tag; // If boot tag is used, serve assets locally, otherwise respect - // APP_STATIC_URL or APP_HOME_URL. - const staticOrigin = staticTag === 'boot' ? '' : (process.env.APP_STATIC_URL || config.homeUrl || ''); - const staticBaseUrl = `${trimEnd(staticOrigin, '/')}/v/${staticTag}/`; + // APP_STATIC_URL. + const staticOrigin = staticTag === 'boot' ? '' : (process.env.APP_STATIC_URL || ''); + const staticBaseUrl = `${staticOrigin}/v/${staticTag}/`; const customHeadHtmlSnippet = server.create.getExtraHeadHtml?.() ?? ""; const warning = testLogin ? "
Authentication is not enforced
" : ""; // Preload all languages that will be used or are requested by client.