The Free Software Media System - Server Backend & API
Start the webhost before RunStartupTasks and fix ContentEncoding
Claus Vium1cc433eabc48
diff --git a/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs b/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.csindex 24fd36062f..976f2ec065 100644--- a/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs+++ b/Emby.Server.Implementations/SocketSharp/WebSocketSharpRequest.cs@@ -408,11 +408,28 @@ namespace Emby.Server.Implementations.SocketSharppublic string ContentType => request.ContentType;- private Encoding contentEncoding;- public Encoding ContentEncoding+ private Encoding ContentEncoding{- get => contentEncoding ?? Encoding.GetEncoding(request.Headers[HeaderNames.ContentEncoding].ToString());- set => contentEncoding = value;+ get+ {+ // TODO is this necessary?+ if (UserAgent != null && CultureInfo.InvariantCulture.CompareInfo.IsPrefix(UserAgent, "UP"))+ {+ string postDataCharset = Headers["x-up-devcap-post-charset"];+ if (!string.IsNullOrEmpty(postDataCharset))+ {+ try+ {+ return Encoding.GetEncoding(postDataCharset);+ }+ catch (ArgumentException)+ {+ }+ }+ }++ return request.GetTypedHeaders().ContentType.Encoding ?? Encoding.UTF8;+ }}public Uri UrlReferrer => request.GetTypedHeaders().Referer;diff --git a/Jellyfin.Server/Program.cs b/Jellyfin.Server/Program.csindex bfc50468f7..a43c3fea5c 100644--- a/Jellyfin.Server/Program.cs+++ b/Jellyfin.Server/Program.cs@@ -144,7 +144,6 @@ namespace Jellyfin.ServerappHost.ImageProcessor.ImageEncoder = GetImageEncoder(fileSystem, appPaths, appHost.LocalizationManager);await appHost.RunStartupTasks().ConfigureAwait(false);- appHost.Host.Run();// TODO: read input for a stop commandtry