From 3f13851be54ce97df72fc27a15ee74c7600e38b1 Mon Sep 17 00:00:00 2001 From: Bond-009 Date: Tue, 12 Feb 2019 21:06:34 +0100 Subject: [PATCH] Address comments --- Emby.Server.Implementations/HttpServer/HttpResultFactory.cs | 3 ++- Jellyfin.Server/Jellyfin.Server.csproj | 2 +- 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 e7e3308dc7..85a08b05ac 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(IRequest request, T dto, IDictionary 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 fcfeeb225e..b1515df439 100644 --- a/Jellyfin.Server/Jellyfin.Server.csproj +++ b/Jellyfin.Server/Jellyfin.Server.csproj @@ -3,7 +3,7 @@ jellyfin Exe - netcoreapp2.2 + netcoreapp2.1 false diff --git a/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs b/Jellyfin.Server/SocketSharp/WebSocketSharpRequest.cs index d862931542..c2b71e9ef7 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) {