diff options
| author | Bond-009 <bond.009@outlook.com> | 2019-12-18 11:53:41 +0100 |
|---|---|---|
| committer | Bond-009 <bond.009@outlook.com> | 2019-12-18 11:53:41 +0100 |
| commit | a1ca50fd5a74eafa6e609976d90cad42b54137e5 (patch) | |
| tree | 9c64d6914c27a8d7e2f8e6f71d7a5952197705cf /Emby.Server.Implementations/HttpServer/ResponseFilter.cs | |
| parent | 8723bdbb4fb73ed261ac1ba3b6932773e523d78b (diff) | |
| parent | 6b185119aa329764c1ccc57d9be3e81f05680b69 (diff) | |
Merge branch 'namingtests' of https://github.com/Bond-009/jellyfin into namingtests
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/ResponseFilter.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/ResponseFilter.cs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/Emby.Server.Implementations/HttpServer/ResponseFilter.cs b/Emby.Server.Implementations/HttpServer/ResponseFilter.cs index 3e731366e..5e0466629 100644 --- a/Emby.Server.Implementations/HttpServer/ResponseFilter.cs +++ b/Emby.Server.Implementations/HttpServer/ResponseFilter.cs @@ -8,11 +8,17 @@ using Microsoft.Net.Http.Headers; namespace Emby.Server.Implementations.HttpServer { + /// <summary> + /// Class ResponseFilter. + /// </summary> public class ResponseFilter { - private static readonly CultureInfo _usCulture = CultureInfo.ReadOnly(new CultureInfo("en-US")); private readonly ILogger _logger; + /// <summary> + /// Initializes a new instance of the <see cref="ResponseFilter"/> class. + /// </summary> + /// <param name="logger">The logger.</param> public ResponseFilter(ILogger logger) { _logger = logger; @@ -37,7 +43,7 @@ namespace Emby.Server.Implementations.HttpServer if (!string.IsNullOrEmpty(exception.Message)) { - var error = exception.Message.Replace(Environment.NewLine, " "); + var error = exception.Message.Replace(Environment.NewLine, " ", StringComparison.Ordinal); error = RemoveControlCharacters(error); res.Headers.Add("X-Application-Error-Code", error); @@ -55,7 +61,7 @@ namespace Emby.Server.Implementations.HttpServer if (hasHeaders.Headers.TryGetValue(HeaderNames.ContentLength, out string contentLength) && !string.IsNullOrEmpty(contentLength)) { - var length = long.Parse(contentLength, _usCulture); + var length = long.Parse(contentLength, CultureInfo.InvariantCulture); if (length > 0) { |
