From d451386f5d1b2aa08d69040938be2cf9ee89e0ef Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Wed, 18 Feb 2015 23:37:44 -0500 Subject: sync updates --- .../HttpServer/HttpListenerHost.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs') diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index 046941e3c..6e8ba1c1d 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -380,6 +380,14 @@ namespace MediaBrowser.Server.Implementations.HttpServer Priority = route.Priority, Summary = route.Summary }); + + // TODO: This is a hack for iOS. Remove it asap. + routes.Add(new RouteAttribute(DoubleNormalizeRoutePath(route.Path), route.Verbs) + { + Notes = route.Notes, + Priority = route.Priority, + Summary = route.Summary + }); } return routes.ToArray(); @@ -395,6 +403,16 @@ namespace MediaBrowser.Server.Implementations.HttpServer return "mediabrowser/" + path; } + private string DoubleNormalizeRoutePath(string path) + { + if (path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) + { + return "/mediabrowser/mediabrowser" + path; + } + + return "mediabrowser//mediabrowser" + path; + } + /// /// Releases the specified instance. /// -- cgit v1.2.3