diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-02-12 21:06:34 +0100 |
|---|---|---|
| committer | Bond-009 <bond.009@outlook.com> | 2019-02-12 21:06:47 +0100 |
| commit | 3f13851be54ce97df72fc27a15ee74c7600e38b1 (patch) | |
| tree | a6cb6449b048f0a4f1537bad91b3ac84ae9c8000 | |
| parent | ea446fd4a3c41c1350a4faf34044bdf808d334fd (diff) | |
Address comments
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpResultFactory.cs | 3 | ||||
| -rw-r--r-- | Jellyfin.Server/Jellyfin.Server.csproj | 2 | ||||
| -rw-r--r-- | Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs index e7e3308dc..85a08b05a 100644 --- a/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs +++ b/Emby.Server.Implementations/HttpServer/HttpResultFactory.cs @@ -277,7 +277,8 @@ namespace Emby.Server.Implementations.HttpServer private object ToOptimizedResultInternal<T>(IRequest request, T dto, IDictionary<string, string> responseHeaders = null) { - var contentType = request.ResponseContentType?.Split(';')[0]; + // TODO: @bond use Span and .Equals + var contentType = request.ResponseContentType?.Split(';')[0].Trim().ToLowerInvariant(); switch (contentType) { diff --git a/Jellyfin.Server/Jellyfin.Server.csproj b/Jellyfin.Server/Jellyfin.Server.csproj index fcfeeb225..b1515df43 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -3,7 +3,7 @@ <PropertyGroup> <AssemblyName>jellyfin</AssemblyName> <OutputType>Exe</OutputType> - <TargetFramework>netcoreapp2.2</TargetFramework> + <TargetFramework>netcoreapp2.1</TargetFramework> <GenerateAssemblyInfo>false</GenerateAssemblyInfo> </PropertyGroup> diff --git a/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs b/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs index d86293154..c2b71e9ef 100644 --- a/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs +++ b/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs @@ -194,8 +194,8 @@ namespace Jellyfin.Server.SocketSharp { // TODO: @bond move to Span when Span.Split lands // https://github.com/dotnet/corefx/issues/26528 - var contentType = acceptsType?.Split(';')[0]; - acceptsAnything = contentType.IndexOf("*/*", StringComparison.Ordinal) != -1; + var contentType = acceptsType?.Split(';')[0].Trim(); + acceptsAnything = contentType.Equals("*/*", StringComparison.OrdinalIgnoreCase); if (acceptsAnything) { |
