Skip to content

Allow 304 responses with a Content-Length but no body #5878

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

Closed
Tratcher opened this issue Oct 5, 2017 · 1 comment
Closed

Allow 304 responses with a Content-Length but no body #5878

Tratcher opened this issue Oct 5, 2017 · 1 comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions bug This issue describes a behavior which is not expected - a bug. feature-httpsys help wanted Up for grabs. We would accept a PR to help resolve this issue

Comments

@Tratcher
Copy link
Member

Tratcher commented Oct 5, 2017

(Mirrored from aspnet/KestrelHttpServer#2099)

304 Not Modified responses are not allowed to contain a body, but they may still contain an informative Content-Length header similar to a Head response.

https://tools.ietf.org/html/rfc7230#section-3.3.2

A server MAY send a Content-Length header field in a 304 (Not
Modified) response to a conditional GET request (Section 4.1 of
[RFC7232]); a server MUST NOT send Content-Length in such a response
unless its field-value equals the decimal number of octets that would
have been sent in the payload body of a 200 (OK) response to the same
request.
A server MUST NOT send a Content-Length header field in any response
with a status code of 1xx (Informational) or 204 (No Content). A
server MUST NOT send a Content-Length header field in any 2xx
(Successful) response to a CONNECT request (Section 4.3.6 of
[RFC7231]).

MVC started doing this in 2.0 and running into the Response Content-Length mismatch: too few bytes written (0 of 42). error.
aspnet/Mvc#6875
They've patched it for 2.0.1
aspnet/Mvc#6887

@aspnet-hello aspnet-hello transferred this issue from aspnet/HttpSysServer Dec 18, 2018
@aspnet-hello aspnet-hello added this to the Backlog milestone Dec 18, 2018
@aspnet-hello aspnet-hello added area-servers bug This issue describes a behavior which is not expected - a bug. feature-httpsys help wanted Up for grabs. We would accept a PR to help resolve this issue labels Dec 18, 2018
@aspnet-hello
Copy link

Thanks for your feedback. We appreciate your letting us know about the problem you've encountered or suggestion but we are not planning to take further action on this issue because our focus has been on issues with significantly higher customer interest and issues impacting a broad number of customers.

@aspnet-hello aspnet-hello removed this from the Backlog milestone Dec 19, 2018
@dotnet dotnet locked and limited conversation to collaborators Dec 19, 2018
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Jun 2, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions bug This issue describes a behavior which is not expected - a bug. feature-httpsys help wanted Up for grabs. We would accept a PR to help resolve this issue
Projects
None yet
Development

No branches or pull requests

3 participants