fix: update MOTHERSHIP_URL formatting to include subdomain and trim path segments

This commit is contained in:
Ben Allfree 2025-07-17 20:51:23 -07:00
parent ef6c9e1f57
commit 1e02cb466a
2 changed files with 7 additions and 2 deletions

View File

@ -0,0 +1,5 @@
---
'pockethost': patch
---
update MOTHERSHIP_URL formatting to include subdomain and trim path segments

View File

@ -196,9 +196,9 @@ export const MOTHERSHIP_URL = (...path: string[]) =>
[
env
.get('MOTHERSHIP_URL')
.default(`${HTTP_PROTOCOL()}://${MOTHERSHIP_NAME()}:${APEX_DOMAIN()}`)
.default(`${HTTP_PROTOCOL()}://${MOTHERSHIP_NAME()}.${APEX_DOMAIN()}`)
.asString(),
path.join('/'),
...path.map((p) => p.trim().replace(/^\/+|\/+$/g, '')),
]
.filter(Boolean)
.join('/')