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

Why "add back" headers? Response.Clear() does not remove headers. #56

Closed
VictorioBerra opened this issue Jun 13, 2019 · 1 comment
Closed

Comments

@VictorioBerra
Copy link

foreach (var header in headers)

See https://docs.microsoft.com/en-us/dotnet/api/system.web.httpresponse.clear?view=netframework-4.8#remarks

The Clear method does not clear header information.

@khellang
Copy link
Owner

You're looking at the documentation for System.Web.HttpResponse, i.e. ASP.NET (non-Core). The behavior is different for ASP.NET Core:

https://github.com/aspnet/AspNetCore/blob/f989daca4bc81090e4fc882fbd983be8b0fa84a9/src/Http/Http.Extensions/src/ResponseExtensions.cs#L12-L25

As you can see, it's clearly (no pun intended 😂) clearing the headers 😄

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

2 participants