mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
gh-105626: Change the default return value of HTTPConnection.get_proxy_response_headers
(#105628)
This commit is contained in:
parent
025995fead
commit
490295d651
4 changed files with 19 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue