404 Error - Flushes Response - Does not allow StatusCodePages middlewares to modify the response to a custom 404.html page

27 Views Asked by At

It has been observed that Ocelot middleware flushes the response when a 404 error is raised. Hence any middleware applied to redirect to a custom 404 page does not work. A standard HTML page it seems generated by the Ocelot middleware is rendered on the browser.

Our team checked the HttpContext.response.HasStarted flag via a custom middleware. If Ocelot middleware is present it comes as true else is comes as false when error code 404 is raised.

Is there a workaround to make it work.

0

There are 0 best solutions below