fix: thread API calls 404 on subdomain routing (jeff.rspace.online)
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 <noreply@anthropic.com>
This commit is contained in:
parent
0abfce2991
commit
f4edf3b7ae
|
|
@ -80,6 +80,12 @@ export class FolkThreadBuilder extends HTMLElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
private get basePath() {
|
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/`;
|
return `/${this._space}/rsocials/`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue