mirror of
https://github.com/nsnail/Ocelot.git
synced 2025-04-22 18:22:49 +08:00
Can't set StatusCode after Response has started (#200)
This commit is contained in:
parent
31f526d3cd
commit
0784954971
@ -84,9 +84,12 @@ namespace Ocelot.Errors.Middleware
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void SetInternalServerErrorOnResponse(HttpContext context)
|
private void SetInternalServerErrorOnResponse(HttpContext context)
|
||||||
|
{
|
||||||
|
if (!context.Response.HasStarted)
|
||||||
{
|
{
|
||||||
context.Response.StatusCode = 500;
|
context.Response.StatusCode = 500;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private string CreateMessage(HttpContext context, Exception e)
|
private string CreateMessage(HttpContext context, Exception e)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user