|
|
@ -484,53 +484,6 @@ namespace Emby.Server.Implementations.HttpServer
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (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))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await httpRes.WriteAsync(
|
|
|
|
|
|
|
|
"<!doctype html><html><head><title>Emby</title></head><body>Please update your Emby bookmark to <a href=\"" +
|
|
|
|
|
|
|
|
newUrl + "\">" + newUrl + "</a></body></html>",
|
|
|
|
|
|
|
|
cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (localPath.IndexOf("dashboard/", StringComparison.OrdinalIgnoreCase) != -1 &&
|
|
|
|
|
|
|
|
localPath.IndexOf("web/dashboard", 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))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
await httpRes.WriteAsync(
|
|
|
|
|
|
|
|
"<!doctype html><html><head><title>Emby</title></head><body>Please update your Emby bookmark to <a href=\"" +
|
|
|
|
|
|
|
|
newUrl + "\">" + newUrl + "</a></body></html>",
|
|
|
|
|
|
|
|
cancellationToken).ConfigureAwait(false);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.Equals(localPath, "/web", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
httpRes.Redirect(_defaultRedirectPath);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.Equals(localPath, "/web/", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
httpRes.Redirect("../" + _defaultRedirectPath);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (string.Equals(localPath, "/", StringComparison.OrdinalIgnoreCase))
|
|
|
|
if (string.Equals(localPath, "/", StringComparison.OrdinalIgnoreCase))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
httpRes.Redirect(_defaultRedirectPath);
|
|
|
|
httpRes.Redirect(_defaultRedirectPath);
|
|
|
@ -543,19 +496,6 @@ namespace Emby.Server.Implementations.HttpServer
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.Equals(httpReq.QueryString["r"], "0", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (localPath.EndsWith("web/dashboard.html", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
httpRes.Redirect("index.html#!/dashboard.html");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (localPath.EndsWith("web/home.html", StringComparison.OrdinalIgnoreCase))
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
httpRes.Redirect("index.html");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(GlobalResponse))
|
|
|
|
if (!string.IsNullOrEmpty(GlobalResponse))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// We don't want the address pings in ApplicationHost to fail
|
|
|
|
// We don't want the address pings in ApplicationHost to fail
|
|
|
@ -569,7 +509,6 @@ namespace Emby.Server.Implementations.HttpServer
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
var handler = GetServiceHandler(httpReq);
|
|
|
|
var handler = GetServiceHandler(httpReq);
|
|
|
|
|
|
|
|
|
|
|
|
if (handler != null)
|
|
|
|
if (handler != null)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
await handler.ProcessRequestAsync(this, httpReq, httpRes, _logger, cancellationToken).ConfigureAwait(false);
|
|
|
|
await handler.ProcessRequestAsync(this, httpReq, httpRes, _logger, cancellationToken).ConfigureAwait(false);
|
|
|
|