mirror of
https://github.com/Radarr/Radarr.git
synced 2024-11-04 10:02:40 +01:00
Fixed: login page being returned instead of unauthorized response
This commit is contained in:
parent
c076f1ddb1
commit
eb8ef6c337
@ -77,7 +77,7 @@ private void RemoveLoginHooksForApiCalls(NancyContext context)
|
|||||||
if (context.Request.IsApiRequest())
|
if (context.Request.IsApiRequest())
|
||||||
{
|
{
|
||||||
if ((context.Response.StatusCode == HttpStatusCode.SeeOther &&
|
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.StatusCode == HttpStatusCode.Unauthorized)
|
||||||
{
|
{
|
||||||
context.Response = new { Error = "Unauthorized" }.AsResponse(HttpStatusCode.Unauthorized);
|
context.Response = new { Error = "Unauthorized" }.AsResponse(HttpStatusCode.Unauthorized);
|
||||||
|
Loading…
Reference in New Issue
Block a user