cpython: 6da1ab5f777d (original) (raw)

Mercurial > cpython

changeset 77048:6da1ab5f777d 3.2

Fix Issue14721: Send Content-length: 0 for empty body () in the http.client requests

Senthil Kumaran senthil@uthcode.com
date Sat, 19 May 2012 16:58:09 +0800
parents a9d43e21f7d8
children 732d70746fc0 9f6b7576c08c
files Lib/http/client.py Lib/test/test_httplib.py Misc/NEWS
diffstat 3 files changed, 32 insertions(+), 1 deletions(-)[+] [-] Lib/http/client.py 2 Lib/test/test_httplib.py 28 Misc/NEWS 3

line wrap: on

line diff

--- a/Lib/http/client.py +++ b/Lib/http/client.py @@ -997,7 +997,7 @@ class HTTPConnection: self.putrequest(method, url, **skips)

--- a/Lib/test/test_httplib.py +++ b/Lib/test/test_httplib.py @@ -99,6 +99,34 @@ class HeaderTests(TestCase): conn.request('POST', '/', body, headers) self.assertEqual(conn._buffer.count[header.lower()], 1)

+

+

+

+ def test_putheader(self): conn = client.HTTPConnection('example.com') conn.sock = FakeSocket(None)

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -63,6 +63,9 @@ Core and Builtins Library ------- +- Issue #14721: Send the correct 'Content-length: 0' header when the body is an