mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-11 18:54:01 +00:00
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>
|
||
|---|---|---|
| .. | ||
| Jellyfin.Api.Tests | ||
| Jellyfin.Common.Tests | ||
| Jellyfin.Controller.Tests | ||
| Jellyfin.Extensions.Tests | ||
| Jellyfin.LiveTv.Tests | ||
| Jellyfin.MediaEncoding.Hls.Tests | ||
| Jellyfin.MediaEncoding.Keyframes.Tests | ||
| Jellyfin.MediaEncoding.Tests | ||
| Jellyfin.Model.Tests | ||
| Jellyfin.Naming.Tests | ||
| Jellyfin.Networking.Tests | ||
| Jellyfin.Providers.Tests | ||
| Jellyfin.Server.Implementations.Tests | ||
| Jellyfin.Server.Integration.Tests | ||
| Jellyfin.Server.Tests | ||
| Jellyfin.XbmcMetadata.Tests | ||
| coverletArgs.runsettings | ||
| Directory.Build.props | ||