mirror of
https://github.com/jellyfin/jellyfin.git
synced 2026-07-15 10:43:30 +01:00
Merge pull request #16255 from cosu/fix/streaminfo-malformed-query-string
Fix malformed query string in StreamInfo.ToUrl() causing 500 error via proxies
This commit is contained in:
@@ -895,7 +895,7 @@ public class StreamInfo
|
||||
|
||||
if (SubProtocol == MediaStreamProtocol.hls)
|
||||
{
|
||||
sb.Append("/master.m3u8?");
|
||||
sb.Append("/master.m3u8");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -906,10 +906,10 @@ public class StreamInfo
|
||||
sb.Append('.');
|
||||
sb.Append(Container);
|
||||
}
|
||||
|
||||
sb.Append('?');
|
||||
}
|
||||
|
||||
var queryStart = sb.Length;
|
||||
|
||||
if (!string.IsNullOrEmpty(DeviceProfileId))
|
||||
{
|
||||
sb.Append("&DeviceProfileId=");
|
||||
@@ -1133,6 +1133,12 @@ public class StreamInfo
|
||||
sb.Append(query);
|
||||
}
|
||||
|
||||
// Replace the first '&' with '?' to form a valid query string.
|
||||
if (sb.Length > queryStart)
|
||||
{
|
||||
sb[queryStart] = '?';
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user