소스 검색

fix for m3u8 playlists

Luke Pulverenti 12 년 전
부모
커밋
e73d65f20d
1개의 변경된 파일11개의 추가작업 그리고 1개의 파일을 삭제
  1. 11 1
      MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs

+ 11 - 1
MediaBrowser.Server.Implementations/HttpServer/HttpResultFactory.cs

@@ -10,6 +10,7 @@ using System.Collections.Generic;
 using System.Globalization;
 using System.IO;
 using System.Net;
+using System.Text;
 using System.Threading.Tasks;
 using MimeTypes = MediaBrowser.Common.Net.MimeTypes;
 
@@ -74,7 +75,16 @@ namespace MediaBrowser.Server.Implementations.HttpServer
                 }
                 else
                 {
-                    result = new HttpResult(content, contentType);
+                    var text = content as string;
+
+                    if (text != null)
+                    {
+                        result = new StreamWriter(Encoding.UTF8.GetBytes(text), contentType, _logger);
+                    }
+                    else
+                    {
+                        result = new HttpResult(content, contentType);
+                    }
                 }
             }