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

Announcement: BadHttpRequestException's obsolete and replaced #20614

Closed
Tratcher opened this issue Apr 7, 2020 · 5 comments
Closed

Announcement: BadHttpRequestException's obsolete and replaced #20614

Tratcher opened this issue Apr 7, 2020 · 5 comments
Labels
breaking-change This issue / pr will introduce a breaking change, when resolved / merged.
Milestone

Comments

@Tratcher
Copy link
Member

Tratcher commented Apr 7, 2020

BadHttpRequestException's obsolete and replaced

Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException and Microsoft.AspNetCore.Server.IIS.BadHttpRequestException have been marked as Obsolete and have been changed to derive from the new Microsoft.AspNetCore.Http.BadHttpRequestException. The servers still throw their old exception types for for backwards compatibility, but the obsolete types will be removed in a future release.

See #20339 for the change.

Version introduced

ASP.NET Core 5.0

Old behavior

Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException and Microsoft.AspNetCore.Server.IIS.BadHttpRequestException derived from System.IO.IOException.

New behavior

Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException and Microsoft.AspNetCore.Server.IIS.BadHttpRequestException are obsolete and derive from a new type Microsoft.AspNetCore.Http.BadHttpRequestException which derives from System.IO.IOException.

Reason for change

To consolidate duplicate types and unify behavior across server implementations. An application can now catch the base exception Microsoft.AspNetCore.Http.BadHttpRequestException when using either Kestrel or IIS.

Recommended action

Replace usages of Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException and Microsoft.AspNetCore.Server.IIS.BadHttpRequestException with Microsoft.AspNetCore.Http.BadHttpRequestException.

Category

ASP.NET

Affected APIs

Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException
Microsoft.AspNetCore.Server.IIS.BadHttpRequestException


Issue metadata

  • Issue type: breaking-change
@Tratcher Tratcher added discussion breaking-change This issue / pr will introduce a breaking change, when resolved / merged. labels Apr 7, 2020
@Tratcher Tratcher added this to the Discussions milestone Apr 7, 2020
@bachratyg
Copy link

Please don't forget HttpSys! It still throws plain IOExceptions where the other two already throw their own BadHttpRequest.

@Tratcher
Copy link
Member Author

Tratcher commented Apr 9, 2020

@bachratyg indeed, now that we have a unified type HttpSys can take advantage of it. Filed #20688. Not sure when we'll get to it though.

@bachratyg
Copy link

Sorry, didn't have time in the last post to find and link the original issue: #12409

@Tratcher
Copy link
Member Author

Tratcher commented Apr 9, 2020

The form size limits are a bit different. That's validating individual sections of the form rather than the whole body. I could see still wanting a 413 for some of those, but that's a bit more involved break unrelated to the servers.

@ghost
Copy link

ghost commented Dec 2, 2020

Thank you for contacting us. Due to a lack of activity on this discussion issue we're closing it in an effort to keep our backlog clean. If you believe there is a concern related to the ASP.NET Core framework, which hasn't been addressed yet, please file a new issue.

This issue will be locked after 30 more days of inactivity. If you still wish to discuss this subject after then, please create a new issue!

@ghost ghost closed this as completed Dec 2, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Jan 1, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking-change This issue / pr will introduce a breaking change, when resolved / merged.
Projects
None yet
Development

No branches or pull requests

3 participants