Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need public method to prevent RequestHandler from altering response on 404 status #213

Open
OMGPizzaGuy opened this issue Feb 26, 2021 · 3 comments

Comments

@OMGPizzaGuy
Copy link

I have need to return 404 on requests and return content, but the RequestHandler will replace the returned content even when Response.TrySkipIisCustomErrors = true;

I found a workaround of setting HttpContext.Items["404handler:handled"] = true; but I would like a supported method to prevent the response from being altered.

Thanks!

@Hyoe
Copy link

Hyoe commented Jun 23, 2021

I'm also experiencing the same issue and having to use the same workaround as @OMGPizzaGuy

@marisks
Copy link
Member

marisks commented Jun 28, 2021

Is the URL that returns 404 added to the redirects list?
The RequestHandler does not replace any content, it just redirects if it finds a URL in the redirect list, otherwise, IIS will handle the 404 status code.

@marisks
Copy link
Member

marisks commented Jun 28, 2021

I see that it clears response. Probably that's what is causing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants