Skip to content

fix: strip trailing slash from server URL to prevent // request paths - #169

Open
Emberr wants to merge 1 commit into
kepelet:developfrom
Emberr:bugfix/server-url-trailing-slash
Open

Emberr wants to merge 1 commit into
kepelet:developfrom
Emberr:bugfix/server-url-trailing-slash

Conversation

@Emberr

@Emberr Emberr commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Fixed an issue where a trailing slash in the server URL would break navidrome connections and require a reinstall.

Problem

On login, if the server URL was saved with a trailing slash (e.g. https://host.ts.net/), each request would be built as https://host.ts.net//api/.... Navidrome would then route the // path to /app/ causing login to fail.

Since //auth/login is redirected to /app/, verifyNDSession() accepts the 200 as a valid session and the app doesn't prompt the user to log in again. This makes it so that re-entering the URL without the trailing slash doesn't fix the issue because login() prefers the saved URL. The only workaround was reinstalling as far as I could figure out.

Fix

Added a normalizedServerURL function that trims the whitespace and trailing slashes and applies it when reading and writing serverBaseURL and to the typed URL in AuthService.login()

I tested manually on Navidrome 0.60.3 behind Tailscale Serve, on iOS 27.2 (XCode iPhone 18 Pro Max Simulator). Haven't checked if subpaths such as https://host/navidrome works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant