Files
jellyfin/MediaBrowser.Model
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
..
2021-10-26 13:56:30 +02:00
2020-02-23 12:11:43 +01:00
2025-05-04 08:40:34 -06:00
2025-03-25 16:45:00 +01:00
2026-01-14 18:55:47 +01:00
2025-01-25 20:05:15 -05:00
2025-03-31 17:46:21 -06:00
2026-01-27 11:13:32 +01:00
2020-08-20 15:17:42 +08:00
2022-12-05 15:00:20 +01:00
2026-01-14 18:55:47 +01:00