aboutsummaryrefslogtreecommitdiffstats
path: root/tests/slskd.Tests.Unit/Common/Middleware
AgeCommit message (Collapse)AuthorLines
2026-11-01add unit tests for middlewareJP Dillingham-0/+394
2026-01-14Fix UrlEncodingModelBinder to account for PathBaseAndy Kelk-0/+173
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.