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

Strip Content-Length: 0 from responses that should not have a Content-Length #43417

Merged

Conversation

adityamandaleeka
Copy link
Member

@adityamandaleeka adityamandaleeka commented Aug 19, 2022

We made a change (earlier in RC1, #43103) that tightened up Kestrel's Content-Length handling. Part of the change made it so that we throw if a Content-Length is set on responses that shouldn't have a Content-Length (1xx, 204 responses, or any 2xx responses to a CONNECT request).

This change keeps that behavior for nonzero values of Content-Length. If the Content-Length is present but it's zero, we will now just remove it instead of throwing, since its absence is semantically equivalent.

We keep the existing behavior for 205's (the spec allows Content-Length 0 for those explicitly).

This is the remainder of the RC1 fix for #43316

@adityamandaleeka adityamandaleeka merged commit aad9c23 into dotnet:release/7.0-rc1 Aug 22, 2022
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants