mirror of
https://github.com/fergalmoran/Readarr.git
synced 2026-03-02 11:44:32 +00:00
Fixed: login page being returned instead of unauthorized response
This commit is contained in:
@@ -77,7 +77,7 @@ namespace NzbDrone.Api.Authentication
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user