jellyfin/tests
Cosmin Dumitru 37b50fe13c Fix malformed query string in StreamInfo.ToUrl() causing 500 error via proxies
StreamInfo.ToUrl() generated URLs like `/master.m3u8?&DeviceId=...` (note `?&`)
because `?` was appended to the path and all parameters started with `&`. When
the first optional parameter (DeviceProfileId) was null, the result was a
malformed query string.

This is harmless when clients hit Jellyfin directly (ASP.NET Core tolerates `?&`),
but when accessed through a reverse proxy that parses and re-serializes the URL
(e.g. Home Assistant ingress via aiohttp/yarl), `?&` becomes `?=&` — introducing
an empty-key query parameter. ParseStreamOptions then crashes on `param.Key[0]`
with IndexOutOfRangeException.

Changes:
- StreamInfo.ToUrl(): Track query start position and replace the first `&` with
  `?` after all parameters are appended, producing valid query strings
- ParseStreamOptions: Guard against empty query parameter keys
- Tests: Remove .Replace("?&", "?") workaround that masked the bug

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-18 21:08:35 +01:00
..
Jellyfin.Api.Tests Update to .NET 10.0 2026-01-14 18:55:47 +01:00
Jellyfin.Common.Tests Remove BOM from UTF-8 files 2024-08-30 15:29:48 +02:00
Jellyfin.Controller.Tests Revert changes to DirectoryService 2025-03-27 21:13:27 -06:00
Jellyfin.Extensions.Tests Replace AlphanumericComparator with new CompareOptions.NumericOrdering 2026-01-14 18:55:47 +01:00
Jellyfin.LiveTv.Tests Update to .NET 10.0 2026-01-14 18:55:47 +01:00
Jellyfin.MediaEncoding.Hls.Tests Remove BOM from UTF-8 files 2024-08-30 15:29:48 +02:00
Jellyfin.MediaEncoding.Keyframes.Tests Remove BOM from UTF-8 files 2024-08-30 15:29:48 +02:00
Jellyfin.MediaEncoding.Tests Backport pull request #15807 from jellyfin/release-10.11.z 2025-12-28 07:22:31 -05:00
Jellyfin.Model.Tests Fix malformed query string in StreamInfo.ToUrl() causing 500 error via proxies 2026-02-18 21:08:35 +01:00
Jellyfin.Naming.Tests Merge pull request #14824 from CodyEngel/fix-numeric-titles 2025-11-27 16:32:11 +01:00
Jellyfin.Networking.Tests Fix tests 2026-01-14 18:55:47 +01:00
Jellyfin.Providers.Tests Handle xx as TMDb no language for backdrops (#14941) 2025-10-04 21:04:35 +02:00
Jellyfin.Server.Implementations.Tests Merge pull request #14927 from nileshp87/patch-1 2026-02-02 20:54:06 +01:00
Jellyfin.Server.Integration.Tests Update to .NET 10.0 2026-01-14 18:55:47 +01:00
Jellyfin.Server.Tests Update to .NET 10.0 2026-01-14 18:55:47 +01:00
Jellyfin.XbmcMetadata.Tests add test for new uniqueid nfo key normalisation 2025-10-08 15:32:30 +00:00
coverletArgs.runsettings SkipAutoProps is true by default but set it explicitly 2023-12-31 15:24:23 +01:00
Directory.Build.props Update to .NET 10.0 2026-01-14 18:55:47 +01:00