Skip to content
This repository was archived by the owner on Dec 18, 2018. It is now read-only.

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

Closed
Tratcher opened this issue Oct 5, 2017 · 0 comments
Closed

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

Tratcher opened this issue Oct 5, 2017 · 0 comments

Comments

@Tratcher
Copy link
Member

Tratcher commented Oct 5, 2017

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

@Tratcher Tratcher added the bug label Oct 5, 2017
@muratg muratg added the up-for-grabs We will consider contributions label Feb 13, 2018
@muratg muratg added this to the Backlog milestone Feb 13, 2018
@Tratcher Tratcher added 3 - Done and removed up-for-grabs We will consider contributions labels Feb 15, 2018
@Tratcher Tratcher modified the milestones: Backlog, 2.1.0-preview2 Feb 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants