From 9f06eb781f5992496a7b1a59fb55b0aa6520261f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sun, 31 Mar 2013 13:39:28 -0400 Subject: fixes #97 and creates a library dictionary cache to avoid FindById recursion --- MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs | 4 +++- MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) (limited to 'MediaBrowser.Server.Implementations/HttpServer') diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs index 681b08825..edb227c79 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs @@ -127,6 +127,8 @@ namespace MediaBrowser.Server.Implementations.HttpServer EndpointHostConfig.Instance.MetadataRedirectPath = "metadata"; } + protected static readonly CultureInfo UsCulture = new CultureInfo("en-US"); + /// /// Configures the specified container. /// @@ -184,7 +186,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer if (hasOptions.Options.TryGetValue("Content-Length", out contentLength) && !string.IsNullOrEmpty(contentLength)) { - var length = long.Parse(contentLength); + var length = long.Parse(contentLength, UsCulture); if (length > 0) { diff --git a/MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs b/MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs index a355a2db5..24292f0a1 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/RangeRequestWriter.cs @@ -139,11 +139,11 @@ namespace MediaBrowser.Server.Implementations.HttpServer if (!string.IsNullOrEmpty(vals[0])) { - start = long.Parse(vals[0]); + start = long.Parse(vals[0], UsCulture); } if (!string.IsNullOrEmpty(vals[1])) { - end = long.Parse(vals[1]); + end = long.Parse(vals[1], UsCulture); } _requestedRanges.Add(new KeyValuePair(start, end)); -- cgit v1.2.3