mirror of
https://github.com/python/cpython.git
synced 2025-08-31 14:07:50 +00:00
Fix Issue14721: Send Content-length: 0 for empty body () in the http.client requests
This commit is contained in:
parent
1be320ebdd
commit
5fa4a89601
3 changed files with 32 additions and 1 deletions
|
@ -997,7 +997,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