mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-23 00:32:50 +08:00
Set status code directly (#608)
Makes it possible for middlewares to read status codes and handle errors
This commit is contained in:
parent
44f8e312a8
commit
f934620538
@ -43,14 +43,7 @@ namespace Ocelot.Responder
|
||||
AddHeaderIfDoesntExist(context, new Header("Content-Length", new []{ response.Content.Headers.ContentLength.ToString() }) );
|
||||
}
|
||||
|
||||
context.Response.OnStarting(state =>
|
||||
{
|
||||
var httpContext = (HttpContext)state;
|
||||
|
||||
httpContext.Response.StatusCode = (int)response.StatusCode;
|
||||
|
||||
return Task.CompletedTask;
|
||||
}, context);
|
||||
context.Response.StatusCode = (int)response.StatusCode;
|
||||
|
||||
using(content)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user