diff options
| author | Andy Kelk <andy@andykelk.net> | 2026-01-14 17:53:19 +1100 |
|---|---|---|
| committer | Andy Kelk <andy@andykelk.net> | 2026-01-14 18:08:00 +1100 |
| commit | 707b8b9754b6db4bbf6c6912be343bc0b2ffe7c9 (patch) | |
| tree | 86b667f3f8f9442afa2fbbb202642e1063b0973a /src/slskd/Service/Application/API/Controllers | |
| parent | de27bb420022be4d9a23034cb9adfb72cd740933 (diff) | |
| download | slskd-707b8b9754b6db4bbf6c6912be343bc0b2ffe7c9.tar.gz | |
Fix UrlEncodingModelBinder to account for PathBase
When the application runs with a base path (e.g., /slskd via UsePathBase),
the UrlEncodingModelBinder was incorrectly calculating the URL segment index.
It was using the route template (which doesn't include the base path) to
determine the index, but applying it to the raw URL (which does include the
base path), causing it to extract the wrong segment.
This fix strips the PathBase from the absolute path before splitting it into
segments, ensuring the correct parameter value is extracted regardless of
whether a base path is configured.
Fixes regression introduced in PR #1596 (commits 8849d78c and e7e0cdaf)
where [UrlEncoded] attribute was added to username parameters in v0.24.2.
Also adds comprehensive unit tests to verify the fix works correctly with
and without a base path, including edge cases like query strings and special
characters in usernames.
Diffstat (limited to 'src/slskd/Service/Application/API/Controllers')
0 files changed, 0 insertions, 0 deletions
