mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The port
value in the host header was set to "None". Patch by Demian Brecht.
This commit is contained in:
commit
d4a001b23c
3 changed files with 11 additions and 8 deletions
|
@ -1299,11 +1299,13 @@ class TunnelTests(TestCase):
|
|||
|
||||
self.assertEqual(conn.sock.host, 'proxy.com')
|
||||
self.assertEqual(conn.sock.port, 80)
|
||||
self.assertTrue(b'CONNECT destination.com' in conn.sock.data)
|
||||
self.assertTrue(b'Host: destination.com' in conn.sock.data)
|
||||
self.assertIn(b'CONNECT destination.com', conn.sock.data)
|
||||
# issue22095
|
||||
self.assertNotIn(b'Host: destination.com:None', conn.sock.data)
|
||||
self.assertIn(b'Host: destination.com', conn.sock.data)
|
||||
|
||||
# This test should be removed when CONNECT gets the HTTP/1.1 blessing
|
||||
self.assertTrue(b'Host: proxy.com' not in conn.sock.data)
|
||||
self.assertNotIn(b'Host: proxy.com', conn.sock.data)
|
||||
|
||||
conn.close()
|
||||
conn.request('PUT', '/', '')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue