1
0
mirror of https://github.com/Radarr/Radarr.git synced 2026-04-24 22:35:49 -04:00

Updated Nancy to 2.0

This commit is contained in:
ta264
2019-08-28 22:43:55 +01:00
committed by Qstick
parent 6c4e3b1fd5
commit 79cf3079c3
68 changed files with 394 additions and 400 deletions
@@ -14,7 +14,9 @@ namespace Radarr.Http.ErrorManagement
public void Handle(HttpStatusCode statusCode, NancyContext context)
{
if (statusCode == HttpStatusCode.SeeOther || statusCode == HttpStatusCode.OK)
{
return;
}
if (statusCode == HttpStatusCode.Continue)
{
@@ -23,13 +25,17 @@ namespace Radarr.Http.ErrorManagement
}
if (statusCode == HttpStatusCode.Unauthorized)
{
return;
}
if (context.Response.ContentType == "text/html" || context.Response.ContentType == "text/plain")
{
context.Response = new ErrorModel
{
Message = statusCode.ToString()
}.AsResponse(statusCode);
{
Message = statusCode.ToString()
}.AsResponse(context, statusCode);
}
}
}
}
}