Parcourir la source

Merge pull request #11699 from cvium/fix_livetv

Use MediaType instead of ToString and add text/ as disallowed mimetypes
Joshua M. Boniface il y a 1 an
Parent
commit
46c748d888
1 fichiers modifiés avec 3 ajouts et 1 suppressions
  1. 3 1
      src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs

+ 3 - 1
src/Jellyfin.LiveTv/TunerHosts/M3UTunerHost.cs

@@ -32,6 +32,8 @@ namespace Jellyfin.LiveTv.TunerHosts
     {
         private static readonly string[] _disallowedMimeTypes =
         {
+            "text/plain",
+            "text/html",
             "video/x-matroska",
             "video/mp4",
             "application/vnd.apple.mpegurl",
@@ -118,7 +120,7 @@ namespace Jellyfin.LiveTv.TunerHosts
 
                 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);
                     }