attempt to fix BasePath redirects

This commit is contained in:
kaso17
2017-03-06 15:29:50 +01:00
parent 3b0cfa4aba
commit cdf11067a2

View File

@@ -23,7 +23,7 @@ namespace Jackett.Utils
context.Request.Path = new PathString(context.Request.Path.Value.Substring(Startup.BasePath.Length-1));
}
if (string.IsNullOrWhiteSpace(url.AbsolutePath) || url.AbsolutePath == "/")
if (context.Request.Path == null || string.IsNullOrWhiteSpace(context.Request.Path.ToString()) || context.Request.Path.ToString() == "/")
{
// 301 is the status code of permanent redirect
context.Response.StatusCode = 302;