Skip to content

Commit

Permalink
Backport pull request #11699 from jellyfin/release-10.9.z
Browse files Browse the repository at this point in the history
Use MediaType instead of ToString and add text/ as disallowed mimetypes

Original-merge: 46c748d

Merged-by: joshuaboniface <joshua@boniface.me>

Backported-by: Joshua M. Boniface <joshua@boniface.me>
  • Loading branch information
cvium authored and joshuaboniface committed May 17, 2024
1 parent 4ded042 commit 01946c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ public class M3UTunerHost : BaseTunerHost, ITunerHost, IConfigurableTunerHost
{
private static readonly string[] _disallowedMimeTypes =
{
"text/plain",
"text/html",
"video/x-matroska",
"video/mp4",
"application/vnd.apple.mpegurl",
Expand Down Expand Up @@ -118,7 +120,7 @@ protected override async Task<ILiveStream> GetChannelStream(TunerHostInfo tunerH

if (response.IsSuccessStatusCode)
{
if (!_disallowedMimeTypes.Contains(response.Content.Headers.ContentType?.ToString(), StringComparison.OrdinalIgnoreCase))
if (!_disallowedMimeTypes.Contains(response.Content.Headers.ContentType?.MediaType, StringComparison.OrdinalIgnoreCase))
{
return new SharedHttpStream(mediaSource, tunerHost, streamId, FileSystem, _httpClientFactory, Logger, Config, _appHost, _streamHelper);
}
Expand Down

0 comments on commit 01946c6

Please sign in to comment.