]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
gh-66897: Upgrade HTTP CONNECT to protocol HTTP/1.1 (#8305)
authorMichael Handler <mh@grendel.net>
Wed, 5 Apr 2023 04:55:24 +0000 (21:55 -0700)
committerGitHub <noreply@github.com>
Wed, 5 Apr 2023 04:55:24 +0000 (21:55 -0700)
commit1a8f862e329c3872a11d4ef8eb85cf353ca2f4d5
treead3f1ab9e0a427dd2fa61f976e169d06eea9a053
parenta62ff970750267441a7175b1bd6d6b2ec59d9a2c
gh-66897: Upgrade HTTP CONNECT to protocol HTTP/1.1 (#8305)

* bpo-22708: Upgrade HTTP CONNECT to protocol HTTP/1.1 (GH-NNNN)

Use protocol HTTP/1.1 when sending HTTP CONNECT tunnelling requests;
generate Host: headers if one is not already provided (required by
HTTP/1.1), convert IDN domains to punycode in HTTP CONNECT requests.

* Refactor tests to pass under -bb (fix ByteWarnings); missed some lines >80.

* Use consistent 'tunnelling' spelling in Lib/http/client.py

* Lib/test/test_httplib: Remove remnant of obsoleted test.

* Use dict.copy() not copy.copy()

* fix version changed

* Update Lib/http/client.py

Co-authored-by: bgehman <bgehman@users.noreply.github.com>
* Switch to for/else: syntax, as suggested

* Don't use for: else:

* Sure, fine, w/e

* Oops

* 1nm to the left

---------

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: bgehman <bgehman@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
Doc/library/http.client.rst
Lib/http/client.py
Lib/test/test_httplib.py
Misc/ACKS
Misc/NEWS.d/next/Library/2018-07-16-14-10-29.bpo-22708.592iRR.rst [new file with mode: 0644]