This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author kxroberto
Recipients kxroberto, nosklo, pitrou, pje
Date 2017-05-09.15:25:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1494343531.43.0.590335958992.issue3839@psf.upfronthosting.co.za>
In-reply-to
Content
However, setting a default "0" when no content, that is still too much in general. 

In case of a '304 Not Modified' for example (which is probably the most frequent HTTP status used on the web overall!) a Content-Length header  obviously is disallowed at all according to 
https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.3.5

"this prevents inconsistencies between cached entity-bodies and updated headers"

Apache, NGINX and other servers observed indeed do not set Content-Length in 304.  And there were bugfix issues regarding that.

Some browsers obviously pick up a Content-Length "0", update the cached resource and thus zero the cached data. Literally obeying "If a cache uses a received 304 response to update a cache entry, the cache MUST update the entry to reflect any new field values given in the response."  (Though that seems rather silly, as that would mean "Modified". And Content-Length should reasonably perhaps be better always associated with the current transmission for needs of keep-alive connections and buffer management at a lower level, and not with cache & status issues.)

Possibly the same problem for 204.
History
Date User Action Args
2017-05-09 15:25:31kxrobertosetrecipients: + kxroberto, pje, pitrou, nosklo
2017-05-09 15:25:31kxrobertosetmessageid: <1494343531.43.0.590335958992.issue3839@psf.upfronthosting.co.za>
2017-05-09 15:25:31kxrobertolinkissue3839 messages
2017-05-09 15:25:31kxrobertocreate