summaryrefslogtreecommitdiffstats
path: root/Lib/http/client.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.8] bpo-37440: Enable TLS 1.3 post-handshake auth in http.client ↵Miss Islington (bot)2019-07-011-0/+7
| | | | | | | | | | | | | | | (GH-14448) (GH-14495) Post-handshake authentication is required for conditional client cert authentication with TLS 1.3. https://bugs.python.org/issue37440 (cherry picked from commit d1bd6e79da1ee56dc1b902d804216ffd267399db) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37440
* bpo-36793: Remove unneeded __str__ definitions. (GH-13081)Serhiy Storchaka2019-05-061-2/+1
| | | | Classes that define __str__ the same as __repr__ can just inherit it from object.
* bpo-30458: Use InvalidURL instead of ValueError. (GH-13044)Gregory P. Smith2019-05-011-1/+1
| | | Use http.client.InvalidURL instead of ValueError as the new error case's exception.
* bpo-30458: Disallow control chars in http URLs. (GH-12755)Gregory P. Smith2019-05-011-0/+14
| | | Disallow control chars in http URLs in urllib.urlopen. This addresses a potential security problem for applications that do not sanity check their URLs where http request headers could be injected.
* bpo-36050: optimize HTTPResponse.read() (GH-12698)Inada Naoki2019-04-061-32/+10
| | | | * No need to chunking for now. * No need to partial read caused by EINTR for now.
* bpo-36522: Print all values for headers with multiple values. (GH-12681)Matt Houglum2019-04-041-2/+2
|
* bpo-33365: print the header values beside the keys (GH-6611)Marco Strigl2018-06-191-1/+1
| | | | | with debuglevel=1 only the header keys got printed. With this change the header values get printed as well and the single header entries get '\n' as a separator.
* bpo-31399: Let OpenSSL verify hostname and IP address (#3462)Christian Heimes2018-01-271-8/+2
| | | | | | | | | | | | | | | bpo-31399: Let OpenSSL verify hostname and IP The ssl module now uses OpenSSL's X509_VERIFY_PARAM_set1_host() and X509_VERIFY_PARAM_set1_ip() API to verify hostname and IP addresses. * Remove match_hostname calls * Check for libssl with set1_host, libssl must provide X509_VERIFY_PARAM_set1_host() * Add documentation for OpenSSL 1.0.2 requirement * Don't support OpenSSL special mode with a leading dot, e.g. ".example.org" matches "www.example.org". It's not standard conform. * Add hostname_checks_common_name Signed-off-by: Christian Heimes <christian@python.org>
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-141-1/+1
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* bpo-31945: Configurable blocksize in HTTP(S)Connection (#4279)Nir Soffer2017-11-061-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | blocksize was hardcoded to 8192, preventing efficient upload when using file-like body. Add blocksize argument to __init__, so users can configure the blocksize to fit their needs. I tested this uploading data from /dev/zero to a web server dropping the received data, to test the overhead of the HTTPConnection.send() with a file-like object. Here is an example 10g upload with the default buffer size (8192): $ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/ Uploaded 10.00g in 17.53 seconds (584.00m/s) real 0m17.574s user 0m8.887s sys 0m5.971s Same with 512k blocksize: $ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/ Uploaded 10.00g in 6.60 seconds (1551.15m/s) real 0m6.641s user 0m3.426s sys 0m2.162s In real world usage the difference will be smaller, depending on the local and remote storage and the network. See https://github.com/nirs/http-bench for more info.
* Remove duplicate line in Lib/http/client.py (#1665)remitamine2017-05-191-1/+0
|
* bpo-30144: Import collections ABC from collections.abc rather than ↵Serhiy Storchaka2017-04-241-2/+2
| | | | collections. (#1263)
* Remove unused imports.Serhiy Storchaka2016-12-161-1/+0
|
* Issue #23214: Remove BufferedReader.read1(-1) workaroundMartin Panter2016-10-211-8/+1
|
* Issue #28022: Deprecate ssl-related arguments in favor of SSLContext.Christian Heimes2016-09-101-0/+6
| | | | | | | The deprecation include manual creation of SSLSocket and certfile/keyfile (or similar) in ftplib, httplib, imaplib, smtplib, poplib and urllib. ssl.wrap_socket() is not marked as deprecated yet.
* Issue 27948: Allow backslashes in the literal string portion of f-strings, ↵Eric V. Smith2016-09-101-1/+1
| | | | but not in the expressions. Also, require expressions to begin and end with literal curly braces.
* [merge from 3.5] - Issue28010 - Make http.client.HTTPConnection.putrequestSenthil Kumaran2016-09-081-1/+2
|\ | | | | | | documentation consistent with the code.
| * Issue28010 - Make http.client.HTTPConnection.putrequest documentation ↵Senthil Kumaran2016-09-081-1/+2
| | | | | | | | consistent with the code.
| * Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Martin Panter2016-09-071-1/+1
| |
* | #27364: fix "incorrect" uses of escape character in the stdlib.R David Murray2016-09-081-1/+1
| | | | | | | | | | | | | | And most of the tools. Patch by Emanual Barry, reviewed by me, Serhiy Storchaka, and Martin Panter.
* | Issue 27921: Remove backslash from another f-string.Eric V. Smith2016-09-031-1/+1
| |
* | Issue #27895: Spelling fixes (Contributed by Ville Skyttä).Raymond Hettinger2016-08-301-1/+1
| |
* | Issue #12319: Always send file request bodies using chunked encodingMartin Panter2016-08-271-23/+8
| | | | | | | | | | | | | | The previous attempt to determine the file’s Content-Length gave a false positive for pipes on Windows. Also, drop the special case for sending zero-length iterable bodies.
* | Issue #12319: Support for chunked encoding of HTTP request bodiesMartin Panter2016-08-241-50/+149
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the body object is a file, its size is no longer determined with fstat(), since that can report the wrong result (e.g. reading from a pipe). Instead, determine the size using seek(), or fall back to chunked encoding for unseekable files. Also, change the logic for detecting text files to check for TextIOBase inheritance, rather than inspecting the “mode” attribute, which may not exist (e.g. BytesIO and StringIO). The Content-Length for text files is no longer determined ahead of time, because the original logic could have been wrong depending on the codec and newline translation settings. Patch by Demian Brecht and Rolf Krahl, with a few tweaks by me.
* | Merge typo fixes from 3.5Martin Panter2016-04-051-1/+1
|\ \ | |/
| * Fix typos in documentation and commentsMartin Panter2016-04-051-1/+1
| |
* | Issue #26499: Merge HTTPResponse fix from 3.5Martin Panter2016-03-171-0/+8
|\ \ | |/
| * Issue #26499: Fixes to HTTPResponse.readline() and read1(), by Silent GhostMartin Panter2016-03-171-0/+8
| |
* | Issue #26045: Merge http.client error addition from 3.5Martin Panter2016-02-091-1/+16
|\ \ | |/
| * Issue #26045: Add UTF-8 suggestion to error in http.clientMartin Panter2016-02-091-1/+16
| | | | | | | | Based on patch by Guido van Rossum.
* | Issue #25899: Converted non-ASCII characters in docstrings and manpageSerhiy Storchaka2015-12-181-2/+2
|\ \ | |/ | | | | | | to ASCII replacements. Removed UTF-8 BOM from Misc/NEWS. Original patch by Chris Angelico.
* | Add in missing docstrings.Raymond Hettinger2015-08-191-0/+49
|/
* Issue #23865: close() methods in multiple modules now are idempotent and moreSerhiy Storchaka2015-04-101-9/+15
|\ | | | | | | | | robust at shutdown. If needs to release multiple resources, they are released even if errors are occured.
| * Issue #23865: close() methods in multiple modules now are idempotent and moreSerhiy Storchaka2015-04-101-9/+15
| | | | | | | | | | robust at shutdown. If needs to release multiple resources, they are released even if errors are occured.
* | #3566: Clean up handling of remote server disconnects.R David Murray2015-04-051-7/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changeset does two things: introduces a new RemoteDisconnected exception (that subclasses ConnectionResetError and BadStatusLine) so that a remote server disconnection can be detected by client code (and provides a better error message for debugging purposes), and ensures that the client socket is closed if a ConnectionError happens, so that the automatic re-connection code can work if the application handles the error and continues on. Tests are added that confirm that a connection is re-used or not re-used as appropriate to the various combinations of protocol version and headers. Patch by Martin Panter, reviewed by Demian Brecht. (Tweaked only slightly by me.)
* | Merge: #23539: Set Content-Length to 0 for PUT, POST, and PATCH if body is None.R David Murray2015-03-221-13/+24
|\ \ | |/
| * #23539: Set Content-Length to 0 for PUT, POST, and PATCH if body is None.R David Murray2015-03-221-13/+24
| | | | | | | | | | | | | | | | 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.
* | Issue #22928: Disabled HTTP header injections in http.client.Serhiy Storchaka2015-03-121-0/+37
|\ \ | |/ | | | | Original patch by Demian Brecht.
| * Issue #22928: Disabled HTTP header injections in http.client.Serhiy Storchaka2015-03-121-0/+37
| | | | | | | | Original patch by Demian Brecht.
* | Issue #23439: Add missing entries to http.client.__all__.Berker Peksag2015-02-201-1/+3
|\ \ | |/ | | | | | | | | | | 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.
| * Issue #23439: Add missing entries to http.client.__all__.Berker Peksag2015-02-201-1/+3
| | | | | | | | | | | | | | 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.
* | Issue #13128: Print response headers for CONNECT requests when debuglevel > 0.Berker Peksag2015-02-031-0/+3
| | | | | | | | Patch by Demian Brecht.
* | http.client: disable Nagle's algorithm (closes #23302)Benjamin Peterson2015-01-231-21/+4
| | | | | | | | Patch by Demian Brecht.
* | Issue #21793: Added http.HTTPStatus enums (i.e. HTTPStatus.OK,Serhiy Storchaka2014-12-231-115/+7
| | | | | | | | HTTPStatus.NOT_FOUND). Patch by Demian Brecht.
* | Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The portSerhiy Storchaka2014-12-121-5/+3
|\ \ | |/ | | | | value in the host header was set to "None". Patch by Demian Brecht.
| * Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The portSerhiy Storchaka2014-12-121-5/+3
| | | | | | | | value in the host header was set to "None". Patch by Demian Brecht.
* | merge 3.4 (#22959)Benjamin Peterson2014-12-071-2/+2
|\ \ | |/
| * HTTPSConnection: prefer the context's check_hostname attribute over the ↵Benjamin Peterson2014-12-071-2/+2
| | | | | | | | constructor parameter (#22959)
* | Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails.Serhiy Storchaka2014-12-011-10/+14
|\ \ | |/ | | | | Original patch by Martin Panter.
| * Issue #21032. Fixed socket leak if HTTPConnection.getresponse() fails.Serhiy Storchaka2014-12-011-10/+14
| | | | | | | | Original patch by Martin Panter.