From 7736c8cefc3093d1edcd056f5e89fdb1cdca926f Mon Sep 17 00:00:00 2001 From: Luke Pulverenti Date: Sat, 1 Jun 2013 23:17:10 -0400 Subject: display program data path and bookmark in the dashboard --- .../HttpServer/HttpServer.cs | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'MediaBrowser.Server.Implementations/HttpServer/HttpServer.cs') 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(() => -- cgit v1.2.3