The Wayback Machine - https://web.archive.org/web/20220201180203/https://github.com/dotnet/aspnetcore/pull/39917
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

Brunolins16/issues/39754 #39917

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

@brunolins16
Copy link
Member

@brunolins16 brunolins16 commented Feb 1, 2022

  • You've read the Contributor Guide and Code of Conduct.
  • You've included unit or integration tests for your change, where applicable.
  • You've included inline docs for your change, where applicable.
  • There's an open issue for the PR that you are making. If you'd like to propose a new feature or change, please open an issue to discuss the change or find an existing issue.

Description

This PR introduces two breaking changes:

Empty Input body calculation (a5a47b0)

The biggest change is, in most cases, the Content-Length == null will now be detected as Empty Body.

Before:

csharp request.ContentLength == 0

After:

var hasBody = context.HttpContext.Features.Get<IHttpRequestBodyDetectionFeature>()?.CanHaveBody;
// In case the feature is not registered
hasBody ??= context.HttpContext.Request.ContentLength is not null && context.HttpContext.Request.ContentLength != 0;

hasBody == false

Allowing empty FromBody parameters input based on nullability

As described in the #39754 some parameters will now be allowed as empty input parameter. (752b539)

Fixes #39754 #29570

@msftbot msftbot bot added the area-mvc label Feb 1, 2022
@brunolins16 brunolins16 linked an issue that may be closed by this pull request Feb 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
1 participant