diff options
author | Nikita Sobolev <mail@sobolevn.me> | 2023-07-14 09:55:49 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-13 23:55:49 -0700 |
commit | 490295d651d04ec3b3eff2a2cda7501191bad78a (patch) | |
tree | e03fd7df2983bc6a97620c49ea3bbadf50e2aa7a /Lib/test/test_httplib.py | |
parent | 025995feadaeebeef5d808f2564f0fd65b704ea5 (diff) | |
download | cpython-490295d651d04ec3b3eff2a2cda7501191bad78a.tar.gz cpython-490295d651d04ec3b3eff2a2cda7501191bad78a.zip |
gh-105626: Change the default return value of `HTTPConnection.get_proxy_response_headers` (#105628)
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r-- | Lib/test/test_httplib.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py index 8955d45fa93..fe8105ee2bb 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 |