Merge branch 'dev'
CI/CD / deploy (push) Failing after 46s Details

This commit is contained in:
Jeff Emmett 2026-04-16 17:06:50 -04:00
commit 3d43f11f25
3 changed files with 5 additions and 6 deletions

View File

@ -51,14 +51,13 @@ async function buildProjection(c: any) {
// Derive the public base URL from the request so in-timeline "Open in // Derive the public base URL from the request so in-timeline "Open in
// rApp" links resolve against the same origin the user arrived from. // rApp" links resolve against the same origin the user arrived from.
// Default to https — rSpace always runs behind Cloudflare/Traefik TLS in // rSpace production is always behind Cloudflare/Traefik TLS, so for any
// production. Only fall back to http for loopback dev hosts. // non-loopback host we always emit https — forwarded-proto headers can
// be `http` (internal Traefik→container hop) even though the real client
// request was https.
const host = c.req.header('x-forwarded-host') ?? c.req.header('host'); const host = c.req.header('x-forwarded-host') ?? c.req.header('host');
const isLocal = !host || /^(localhost|127\.|\[::1\])/i.test(host); const isLocal = !host || /^(localhost|127\.|\[::1\])/i.test(host);
const forwardedProto = c.req.header('x-forwarded-proto'); const proto = isLocal ? 'http' : 'https';
const proto = forwardedProto === 'http' || forwardedProto === 'https'
? forwardedProto
: (isLocal ? 'http' : 'https');
const baseUrl = host ? `${proto}://${host}` : undefined; const baseUrl = host ? `${proto}://${host}` : undefined;
const sources = await enumerateCreations(space, { modules, from, to }); const sources = await enumerateCreations(space, { modules, from, to });