[issue23539] Content-length not set for HTTP methods expecting body when body is None

Martin Panter report at bugs.python.org
Fri Feb 27 22:47:40 CET 2015


Martin Panter added the comment:

I like Demian’s “expecting_len” technique slightly better because it would avoid calling None.fileno() and len(None), as Demian just said.

Also, I think OPTIONS should be removed from the list of methods that enforce a Content-Length. I wouldn’t normally expect any payload for OPTIONS, since RFC 7231 explicitly says it does not define a use for a payload, but requires a Content-Type if a payload is sent.

----------
nosy: +vadmium

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23539>
_______________________________________


More information about the Python-bugs-list mailing list