From f4edf3b7ae599d3c4138f3f24431148a8515677b Mon Sep 17 00:00:00 2001 From: Jeff Emmett Date: Thu, 5 Mar 2026 16:47:41 -0800 Subject: [PATCH] fix: thread API calls 404 on subdomain routing (jeff.rspace.online) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit basePath was always returning /{space}/rsocials/ which works for path-based routing (rspace.online/jeff/rsocials/) but double-prefixes on subdomain routing (jeff.rspace.online/jeff/rsocials/ → rewritten to /jeff/jeff/rsocials/). Now detects subdomain hosts (*.rspace.online, *.rsocials.online) and returns /rsocials/ without the space prefix, since the space is the subdomain. Co-Authored-By: Claude Opus 4.6 --- modules/rsocials/components/folk-thread-builder.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/rsocials/components/folk-thread-builder.ts b/modules/rsocials/components/folk-thread-builder.ts index b8bc318..4aa9b55 100644 --- a/modules/rsocials/components/folk-thread-builder.ts +++ b/modules/rsocials/components/folk-thread-builder.ts @@ -80,6 +80,12 @@ export class FolkThreadBuilder extends HTMLElement { } private get basePath() { + // On subdomain routing (e.g. jeff.rspace.online), the space is the subdomain + // and paths should be /rsocials/... not /jeff/rsocials/... + const host = window.location.hostname; + if (host.endsWith('.rspace.online') || host.endsWith('.rsocials.online')) { + return '/rsocials/'; + } return `/${this._space}/rsocials/`; }