summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2023-07-14 07:21:02 (GMT)
committerGitHub <noreply@github.com>2023-07-14 07:21:02 (GMT)
commite68b2806717997db4fae338f906bd8d60ae9381f (patch)
treec44cb5ee5a7cfd3e35939e803d7ed56a98e9fb49 /Lib/test
parent6a1a6601582ea893a81fd613f6432c85fc14f460 (diff)
downloadcpython-e68b2806717997db4fae338f906bd8d60ae9381f.zip
cpython-e68b2806717997db4fae338f906bd8d60ae9381f.tar.gz
cpython-e68b2806717997db4fae338f906bd8d60ae9381f.tar.bz2
[3.12] gh-105626: Change the default return value of `HTTPConnection.get_proxy_response_headers` (GH-105628) (#106738)
gh-105626: Change the default return value of `HTTPConnection.get_proxy_response_headers` (GH-105628) (cherry picked from commit 490295d651d04ec3b3eff2a2cda7501191bad78a) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_httplib.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 8955d45..fe8105e 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -2404,6 +2404,19 @@ class TunnelTests(TestCase):
headers = self.conn.get_proxy_response_headers()
self.assertIn(expected_header, headers.items())
+ def test_no_proxy_response_headers(self):
+ expected_header = ('X-Dummy', '1')
+ response_text = (
+ 'HTTP/1.0 200 OK\r\n'
+ '{0}\r\n\r\n'.format(':'.join(expected_header))
+ )
+
+ self.conn._create_connection = self._create_connection(response_text)
+
+ self.conn.request('PUT', '/', '')
+ headers = self.conn.get_proxy_response_headers()
+ self.assertIsNone(headers)
+
def test_tunnel_leak(self):
sock = None