diff --git a/src/Jackett/Utils/WebApiRootRedirectMiddleware.cs b/src/Jackett/Utils/WebApiRootRedirectMiddleware.cs index b41795ecf..5360a099b 100644 --- a/src/Jackett/Utils/WebApiRootRedirectMiddleware.cs +++ b/src/Jackett/Utils/WebApiRootRedirectMiddleware.cs @@ -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;