-
Notifications
You must be signed in to change notification settings - Fork 9.8k
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
Comments
Please don't forget HttpSys! It still throws plain IOExceptions where the other two already throw their own BadHttpRequest. |
@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. |
Sorry, didn't have time in the last post to find and link the original issue: #12409 |
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. |
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! |
BadHttpRequestException's obsolete and replaced
Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException
andMicrosoft.AspNetCore.Server.IIS.BadHttpRequestException
have been marked as Obsolete and have been changed to derive from the newMicrosoft.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
andMicrosoft.AspNetCore.Server.IIS.BadHttpRequestException
derived fromSystem.IO.IOException
.New behavior
Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException
andMicrosoft.AspNetCore.Server.IIS.BadHttpRequestException
are obsolete and derive from a new typeMicrosoft.AspNetCore.Http.BadHttpRequestException
which derives fromSystem.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
andMicrosoft.AspNetCore.Server.IIS.BadHttpRequestException
withMicrosoft.AspNetCore.Http.BadHttpRequestException
.Category
ASP.NET
Affected APIs
Microsoft.AspNetCore.Server.Kestrel.BadHttpRequestException
Microsoft.AspNetCore.Server.IIS.BadHttpRequestException
Issue metadata
The text was updated successfully, but these errors were encountered: