diff options
| author | Bond_009 <bond.009@outlook.com> | 2019-11-01 18:38:54 +0100 |
|---|---|---|
| committer | Bond_009 <bond.009@outlook.com> | 2019-11-27 16:29:56 +0100 |
| commit | 42ffddc26932bcf2da762bf4fe1ec4bdc42e8166 (patch) | |
| tree | 3e412b3a58f2915092abee792572de209844b731 /Emby.Server.Implementations/HttpServer/ResponseFilter.cs | |
| parent | f3ca4631c39e89afa0cc4af3631016c00e47037c (diff) | |
Fix more warnings
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) { |
