mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
merge - Fix Issue14721: Send Content-length: 0 for empty body () in the http.client requests
This commit is contained in:
commit
d34b57a9a2
3 changed files with 32 additions and 1 deletions
|
|
@ -1076,7 +1076,7 @@ class HTTPConnection:
|
|||
|
||||
self.putrequest(method, url, **skips)
|
||||
|
||||
if body and ('content-length' not in header_names):
|
||||
if body is not None and ('content-length' not in header_names):
|
||||
self._set_content_length(body)
|
||||
for hdr, value in headers.items():
|
||||
self.putheader(hdr, value)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue