mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-22 22:15:17 -04:00
New: Use ASP.NET Core instead of Nancy
This commit is contained in:
@@ -1,4 +1,8 @@
|
||||
using Radarr.Http.Exceptions;
|
||||
using System.Net;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using NzbDrone.Common.Serializer;
|
||||
using Radarr.Http.Exceptions;
|
||||
|
||||
namespace Radarr.Http.ErrorManagement
|
||||
{
|
||||
@@ -17,5 +21,12 @@ namespace Radarr.Http.ErrorManagement
|
||||
public ErrorModel()
|
||||
{
|
||||
}
|
||||
|
||||
public Task WriteToResponse(HttpResponse response, HttpStatusCode statusCode = HttpStatusCode.InternalServerError)
|
||||
{
|
||||
response.StatusCode = (int)statusCode;
|
||||
response.ContentType = "application/json";
|
||||
return STJson.SerializeAsync(this, response.Body);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user