Files
Naiyuan Qing 2b35f8017a fix(web): validate the browser API base URL (MUL-5922) (#6627)
`resolveBrowserApiBaseUrl` only trimmed trailing slashes, so a relative
`NEXT_PUBLIC_API_URL=/api` became the XHR base verbatim: every API call
went to `/api/api/**` and every avatar/attachment to `/api/uploads/**`,
which the backend serves at the root. The sibling server-side resolver
already used the strict `cleanHttpUrl`; this aligns the browser path with
it and additionally strips a trailing `/api` from the base, which fixes
the absolute `https://host/api` spelling on both paths.

Regression from #4840 (first tagged in v0.4.10), which wired up a
variable that had been inert in published images. Reported in #6619.

Refs: #6619

Co-authored-by: multica-agent <github@multica.ai>
2026-08-08 17:34:05 +08:00
..