aboutsummaryrefslogtreecommitdiff
path: root/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs')
-rw-r--r--MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs27
1 files changed, 27 insertions, 0 deletions
diff --git a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
index f4bf501e3..91d79bda0 100644
--- a/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
+++ b/MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs
@@ -306,6 +306,33 @@ namespace MediaBrowser.Server.Implementations.HttpServer
return;
}
+ var localPath = context.Request.Url.LocalPath;
+
+ if (string.Equals(localPath, "/mediabrowser/", StringComparison.OrdinalIgnoreCase))
+ {
+ context.Response.Redirect(DefaultRedirectPath);
+ context.Response.Close();
+ return;
+ }
+ if (string.Equals(localPath, "/mediabrowser", StringComparison.OrdinalIgnoreCase))
+ {
+ context.Response.Redirect("mediabrowser/" + DefaultRedirectPath);
+ context.Response.Close();
+ return;
+ }
+ if (string.Equals(localPath, "/", StringComparison.OrdinalIgnoreCase))
+ {
+ context.Response.Redirect("mediabrowser/" + DefaultRedirectPath);
+ context.Response.Close();
+ return;
+ }
+ if (string.IsNullOrEmpty(localPath))
+ {
+ context.Response.Redirect("/mediabrowser/" + DefaultRedirectPath);
+ context.Response.Close();
+ return;
+ }
+
RaiseReceiveWebRequest(context);
await Task.Factory.StartNew(() =>