Fix incorrect response StatusCode for middleware added before Ocelot (#380)

This commit is contained in:
Alex Kuriatnyk 2018-06-11 12:23:45 -07:00 committed by Tom Pallister
parent 3bde18f6f8
commit 095406bd45

View File

@ -59,12 +59,8 @@ namespace Ocelot.Responder
}
public void SetErrorResponseOnContext(HttpContext context, int statusCode)
{
context.Response.OnStarting(x =>
{
context.Response.StatusCode = statusCode;
return Task.CompletedTask;
}, context);
}
private static void AddHeaderIfDoesntExist(HttpContext context, Header httpResponseHeader)