Repository navigation
fix(subsonic): percent-encode the username in request URLs - #855
LargeModGames merged 1 commit into
Conversation
endpoint_url put the username into the query string raw, so a name with +, &, #, %, = or a space reached the server altered and every request failed with Subsonic error 40. Encode it with the existing url_encode. Signed-off-by: Gaurav Jadhav <[email protected]>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
@all-contributors please add @jadhavgaurav for code |
|
@jadhavgaurav already contributed before to code |
|
oops |
Summary
SubsonicSource::endpoint_urlputself.usernameinto the?u=query value without encoding it, so a username with+,&,#,%,=or a space reached the server changed or cut off, and every request failed with Subsonic error 40. The username now goes through the existingurl_encodehelper, asstream_urlalready does for the track id.url_encode,base_url,view,compute_tokenandgenerate_saltare untouched, andself.usernameis not used in any other URL.Adds three tests in the subsonic
testsmodule (an encoded mixed username, one with#,%and=, and a plain name that must stay unchanged) and aCHANGELOG.mdFixed line.Fixes #814
Testing
AI assistance: partially generated with Claude Code; I read the whole diff and ran every command below locally.
endpoint_urlchange reverted,a_username_with_query_characters_is_percent_encodedfails on theu=assert; with the fix it passes.cargo test --no-default-features --features telemetry,tui,subsonic a_username_with_query: 1 passedcargo test --no-default-features --features telemetry,tui,subsonic: 1645 passed, 0 failed, 13 ignored (includesurl_encode_encodes_spaces_and_specialsandcreate_playlist_encodes_the_name_and_returns_the_new_id)cargo fmt --all -- --check: cleancargo clippy --no-default-features --features telemetry,tui -- -D warnings: cleancargo clippy --no-default-features --features telemetry,tui,subsonic -- -D warnings: cleancargo test --no-default-features --features telemetry,tui: 1596 passed, 0 failedAdditional notes
I did not run the optional manual check against a Navidrome server.
Summary by CodeRabbit