summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httplib.py
diff options
context:
space:
mode:
authorAlexey Namyotkin <62434915+nametkin@users.noreply.github.com>2023-05-05 18:52:24 (GMT)
committerGitHub <noreply@github.com>2023-05-05 18:52:24 (GMT)
commit1afe0e0320c6f19418d44d682ad95ba0c689c595 (patch)
treeca5a90d981c24ace231624c75195a5ae880530b6 /Lib/test/test_httplib.py
parentb9797417315cc2d1700cb2d427685016d3380711 (diff)
downloadcpython-1afe0e0320c6f19418d44d682ad95ba0c689c595.zip
cpython-1afe0e0320c6f19418d44d682ad95ba0c689c595.tar.gz
cpython-1afe0e0320c6f19418d44d682ad95ba0c689c595.tar.bz2
gh-69152: Add _proxy_response_headers attribute to HTTPConnection (#26152)
Add _proxy_response_headers attribute to HTTPConnection (#26152) --------- Co-authored-by: Senthil Kumaran <senthil@python.org>
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r--Lib/test/test_httplib.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 37f77fe..4b1d355 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -2390,6 +2390,20 @@ class TunnelTests(TestCase):
lines = output.getvalue().splitlines()
self.assertIn('header: {}'.format(expected_header), lines)
+ def test_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.set_tunnel('destination.com')
+
+ self.conn.request('PUT', '/', '')
+ headers = self.conn._proxy_response_headers
+ self.assertIn(expected_header, headers.items())
+
def test_tunnel_leak(self):
sock = None