Commit Graph

110 Commits

Author SHA1 Message Date
R David Murray beed8402ca #23539: Set Content-Length to 0 for PUT, POST, and PATCH if body is None.
Some http servers will reject PUT, POST, and PATCH requests if they
do not have a Content-Length header.

Patch by James Rutherford, with additional cleaning up of the
'request' documentation by me.
2015-03-22 15:18:23 -04:00
Serhiy Storchaka a112a8ae47 Issue #22928: Disabled HTTP header injections in http.client.
Original patch by Demian Brecht.
2015-03-12 11:13:36 +02:00
Victor Stinner b389b48265 Issue #23526: Fix ResourceWarning in test_httplib. Patch written by Alex Shkop. 2015-02-27 17:47:23 +01:00
Berker Peksag babc688180 Issue #23439: Add missing entries to http.client.__all__.
Also, document the LineTooLong exception since it can be raised by
the members of public API (e.g. http.client.HTTPResponse).

Patch by Martin Panter.
2015-02-20 09:39:38 +02:00
Benjamin Peterson 155ceaa454 handle headers with no key (closes #19996)
Patch by Cory Benfield.
2015-01-25 23:30:30 -05:00
Senthil Kumaran e6cc70123e Increase http.client.HTTPConnection test coverage.
Added a new tunnel test to verify setting of _tunnel_host, _tunnel_port,
_tunnel_headers attributes on HTTPConnection object.
2015-01-24 19:24:59 -08:00
Benjamin Peterson 9566de18e6 make sure server threads get cleaned up 2014-12-13 16:13:24 -05:00
Serhiy Storchaka 4ac7ed97a8 Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The port
value in the host header was set to "None".  Patch by Demian Brecht.
2014-12-12 09:29:15 +02:00
Benjamin Peterson a090f01bb6 HTTPSConnection: prefer the context's check_hostname attribute over the constructor parameter (#22959) 2014-12-07 13:18:25 -05:00
Serhiy Storchaka b491e0521f Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails.
Original patch by Martin Panter.
2014-12-01 13:07:45 +02:00
Benjamin Peterson 2615e9e293 don't fail tests when www.python.org can't be validated by the system 2014-11-25 15:16:55 -06:00
Georg Brandl fbaf931096 test_httplib: use self-signed.pythontest.net for verification test with non-root-CA cert 2014-11-05 20:37:40 +01:00
Benjamin Peterson 4ffb075271 PEP 476: enable HTTPS certificate verification by default (#22417)
Patch by Alex Gaynor with some modifications by me.
2014-11-03 14:29:33 -05:00
Senthil Kumaran 9da047b3a5 Issue #7776: Fix ``Host:'' header and reconnection when using http.client.HTTPConnection.set_tunnel().
Patch by Nikolaus Rath.
2014-04-14 13:07:56 -04:00
Serhiy Storchaka d3e1207191 Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref tests. 2014-02-08 14:51:10 +02:00
Serhiy Storchaka 25d8aeac7c Issue #20555: Use specific asserts in urllib, httplib, ftplib, cgi, wsgiref tests. 2014-02-08 14:50:08 +02:00
Serhiy Storchaka cac05e2e90 Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
2013-12-17 21:51:40 +02:00
Serhiy Storchaka 1c84ac1f55 Issue #20007: HTTPResponse.read(0) no more prematurely closes connection.
Original patch by Simon Sapin.
2013-12-17 21:50:02 +02:00
Georg Brandl bf3f8eb960 Issue #16037: HTTPMessage.readheaders() raises an HTTPException when more than
100 headers are read.  Adapted from patch by Jyrki Pulliainen.
2013-10-27 07:34:48 +01:00
Georg Brandl b89b5df9c9 merge with 3.3 2013-10-27 07:46:09 +01:00
Serhiy Storchaka 48e6a8c88a Issue #18743: Fix references to non-existant "StringIO" module
in docstrings and comments.
2013-08-29 11:39:48 +03:00
Serhiy Storchaka 50254c57cd Issue #18743: Fix references to non-existant "StringIO" module
in docstrings and comments.
2013-08-29 11:35:43 +03:00
Andrew Svetlov 3042b5ebf4 Issue #16658: add missing return to HTTPConnection.send().
Patch by Jeff Knupp
2013-04-12 22:50:42 +03:00
Andrew Svetlov 7b2c8bb833 Issue #16658: add missing return to HTTPConnection.send().
Patch by Jeff Knupp
2013-04-12 22:49:19 +03:00
Serhiy Storchaka daf990f8a7 Issue #16723: httplib.HTTPResponse no longer marked closed when the connection
is automatically closed.
2013-02-06 10:37:19 +02:00
Serhiy Storchaka b6c86fd87f Issue #16723: httplib.HTTPResponse no longer marked closed when the connection
is automatically closed.
2013-02-06 10:35:40 +02:00
Serhiy Storchaka b5b9c8cd40 Issue #16723: httplib.HTTPResponse no longer marked closed when the connection
is automatically closed.
2013-02-06 10:31:57 +02:00
Antoine Pitrou da23259f99 Issue #17107: Test client-side SNI support in urllib.request thanks to the new server-side SNI support in the ssl module.
Initial patch by Daniel Black.
2013-02-05 21:20:51 +01:00
Antoine Pitrou b5032c85af Issue #15633: httplib.HTTPResponse is now mark closed when the server sends less than the advertised Content-Length. 2013-02-02 23:06:22 +01:00
Antoine Pitrou 6a35e18161 Issue #15633: httplib.HTTPResponse is now mark closed when the server sends less than the advertised Content-Length. 2013-02-02 23:04:56 +01:00
Antoine Pitrou beec61ae4e Issue #15633: httplib.HTTPResponse is now mark closed when the server sends less than the advertised Content-Length. 2013-02-02 22:49:34 +01:00
Antoine Pitrou 90e4774558 Issue #16833: In http.client.HTTPConnection, do not concatenate the request headers and body when the payload exceeds 16 KB, since it can consume more memory for no benefit.
Patch by Benno Leslie.
2013-01-02 22:10:47 +01:00
Andrew Svetlov 0832af6628 Issue #16717: get rid of socket.error, replace with OSError 2012-12-18 23:10:48 +02:00
Antoine Pitrou d20e7745ee Issue #16298: In HTTPResponse.read(), close the socket when there is no Content-Length and the incoming stream is finished.
Patch by Eran Rundstein.
2012-12-15 19:22:30 +01:00
Antoine Pitrou 084daa2f74 Issue #16298: In HTTPResponse.read(), close the socket when there is no Content-Length and the incoming stream is finished.
Patch by Eran Rundstein.
2012-12-15 19:11:54 +01:00
Senthil Kumaran d34b57a9a2 merge - Fix Issue14721: Send Content-length: 0 for empty body () in the http.client requests 2012-05-19 16:58:45 +08:00
Senthil Kumaran 5fa4a89601 Fix Issue14721: Send Content-length: 0 for empty body () in the http.client requests 2012-05-19 16:58:09 +08:00
Senthil Kumaran 889ad16e54 httplib test for early eof response. related to Issue13684 2012-04-29 10:21:26 +08:00
Senthil Kumaran 9c29f86a81 httplib test for early eof response. related to Issue13684 2012-04-29 10:20:46 +08:00
Antoine Pitrou f7e7818e24 Issue #13713: fix a regression in HTTP chunked reading after 806cfe39f729
(originally issue #13464: Add a readinto() method to http.client.HTTPResponse)
2012-01-04 18:57:22 +01:00
Antoine Pitrou 38d9643d5e Issue #13464: Add a readinto() method to http.client.HTTPResponse.
Patch by Jon Kuhn.
2011-12-06 22:33:57 +01:00
Petri Lehtinen cc9695643f Issue #10860: Skip the new test if HTTPS is not available 2011-10-26 21:29:54 +03:00
Petri Lehtinen e119c403a1 Issue #10860: Skip the new test if HTTPS is not available 2011-10-26 21:29:15 +03:00
Łukasz Langa 6c4e1aed4b Merged fix for #10860 from 3.2 2011-10-19 02:04:46 +02:00
Łukasz Langa a5a9a9c369 Fixes #10860: Handle empty port after port delimiter in httplib 2011-10-18 21:17:39 +02:00
Victor Stinner c61fae04f6 Merge 3.2: test_httplib removes temporary files 2011-09-21 01:09:29 +02:00
Victor Stinner 18d15cb665 test_httplib removes temporary files 2011-09-21 01:09:04 +02:00
Brett Cannon 252365bab8 Silence the altered state warning about threadgs when running test_httplib. 2011-08-04 22:43:11 -07:00
Senthil Kumaran eb71ad4c71 Fix closes Issue12676 - Invalid identifier used in TypeError message in http.client.
Reported by Popa Claudiu and Patch by Santoso Wijaya.
2011-08-02 18:33:41 +08:00
Raymond Hettinger 7beae8a0d5 Issue 10825: Minor updates to the test suite. 2011-01-06 05:34:17 +00:00