diff options
| author | dkanada <dkanada@users.noreply.github.com> | 2019-08-05 16:27:10 -0700 |
|---|---|---|
| committer | dkanada <dkanada@users.noreply.github.com> | 2019-08-11 00:35:18 -0700 |
| commit | 97d6c2db6b5749c12ef2f92f6622c28555173c48 (patch) | |
| tree | 3a025658e00235f7aad4654d8fed4f884232aafe /Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | |
| parent | d521e5c36a0396a6e0ee562d8bda6fb5ffc6b0a7 (diff) | |
keep old base url for now
Diffstat (limited to 'Emby.Server.Implementations/HttpServer/HttpListenerHost.cs')
| -rw-r--r-- | Emby.Server.Implementations/HttpServer/HttpListenerHost.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs index 48b229e88..bdcf5d0b7 100644 --- a/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/Emby.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -602,6 +602,13 @@ namespace Emby.Server.Implementations.HttpServer Priority = route.Priority, Summary = route.Summary }); + + routes.Add(new RouteAttribute(NormalizeOldRoutePath(route.Path), route.Verbs) + { + Notes = route.Notes, + Priority = route.Priority, + Summary = route.Summary + }); } return routes.ToArray(); @@ -637,6 +644,17 @@ namespace Emby.Server.Implementations.HttpServer return _socketListener.ProcessWebSocketRequest(context); } + // this method was left for compatibility with third party clients + private static string NormalizeOldRoutePath(string path) + { + if (path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) + { + return "/emby" + path; + } + + return "emby/" + path; + } + private static string NormalizeCustomRoutePath(string baseUrl, string path) { if (path.StartsWith("/", StringComparison.OrdinalIgnoreCase)) |
