diff options
| author | Luke <luke.pulverenti@gmail.com> | 2016-08-25 14:46:19 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-08-25 14:46:19 -0400 |
| commit | ba9577f3801105c2f85c061fa7c4c3ee445032ad (patch) | |
| tree | d06d1da4e2284fcf36c36f7ac1ec84c9613ad812 /MediaBrowser.Server.Implementations/HttpServer | |
| parent | 870c843194a8684d1f1098bbed79ecb27cd3478b (diff) | |
| parent | 1ffd9b31577773d3c87c2b6621c8803b2b17e85c (diff) | |
Merge pull request #2101 from MediaBrowser/beta
Beta
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer')
| -rw-r--r-- | MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs index 633208739..51a53fe21 100644 --- a/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs +++ b/MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs @@ -428,8 +428,24 @@ namespace MediaBrowser.Server.Implementations.HttpServer if (string.Equals(localPath, "/mediabrowser/", StringComparison.OrdinalIgnoreCase) || string.Equals(localPath, "/mediabrowser", StringComparison.OrdinalIgnoreCase) || - localPath.IndexOf("mediabrowser/web", StringComparison.OrdinalIgnoreCase) != -1 || - localPath.IndexOf("dashboard/", StringComparison.OrdinalIgnoreCase) != -1) + localPath.IndexOf("mediabrowser/web", StringComparison.OrdinalIgnoreCase) != -1) + { + httpRes.StatusCode = 200; + httpRes.ContentType = "text/html"; + var newUrl = urlString.Replace("mediabrowser", "emby", StringComparison.OrdinalIgnoreCase) + .Replace("/dashboard/", "/web/", StringComparison.OrdinalIgnoreCase); + + if (!string.Equals(newUrl, urlString, StringComparison.OrdinalIgnoreCase)) + { + httpRes.Write("<!doctype html><html><head><title>Emby</title></head><body>Please update your Emby bookmark to <a href=\"" + newUrl + "\">" + newUrl + "</a></body></html>"); + + httpRes.Close(); + return; + } + } + + if (localPath.IndexOf("dashboard/", StringComparison.OrdinalIgnoreCase) != -1 && + localPath.IndexOf("web/dashboard", StringComparison.OrdinalIgnoreCase) == -1) { httpRes.StatusCode = 200; httpRes.ContentType = "text/html"; |
