aboutsummaryrefslogtreecommitdiff
path: root/Emby.Server.Implementations/HttpServer/ResponseFilter.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/ResponseFilter.cs')
-rw-r--r--Emby.Server.Implementations/HttpServer/ResponseFilter.cs12
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)
{