From eb8ef6c3376f71e14c361b57e123f4072bf47788 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Mon, 24 Oct 2016 20:41:19 -0700 Subject: [PATCH] Fixed: login page being returned instead of unauthorized response --- src/NzbDrone.Api/Authentication/EnableAuthInNancy.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/NzbDrone.Api/Authentication/EnableAuthInNancy.cs b/src/NzbDrone.Api/Authentication/EnableAuthInNancy.cs index 9d826d3d7..b4e6cce62 100644 --- a/src/NzbDrone.Api/Authentication/EnableAuthInNancy.cs +++ b/src/NzbDrone.Api/Authentication/EnableAuthInNancy.cs @@ -77,7 +77,7 @@ private void RemoveLoginHooksForApiCalls(NancyContext context) if (context.Request.IsApiRequest()) { if ((context.Response.StatusCode == HttpStatusCode.SeeOther && - context.Response.Headers["Location"].StartsWith("/login", StringComparison.InvariantCultureIgnoreCase)) || + context.Response.Headers["Location"].StartsWith($"{_configFileProvider.UrlBase}/login", StringComparison.InvariantCultureIgnoreCase)) || context.Response.StatusCode == HttpStatusCode.Unauthorized) { context.Response = new { Error = "Unauthorized" }.AsResponse(HttpStatusCode.Unauthorized);