diff options
| author | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-02-18 23:37:44 -0500 |
|---|---|---|
| committer | Luke Pulverenti <luke.pulverenti@gmail.com> | 2015-02-18 23:37:44 -0500 |
| commit | d451386f5d1b2aa08d69040938be2cf9ee89e0ef (patch) | |
| tree | 78d39e333ebc3cdf5299e706ddb041dd52d351b3 /MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs | |
| parent | 8497c2926f0ed44423f16479a4a234e36f200b68 (diff) | |
sync updates
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs | 18 |
1 files changed, 18 insertions, 0 deletions
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; + } + /// <summary> /// Releases the specified instance. /// </summary> |
