summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_httplib.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2014-12-12 07:29:15 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2014-12-12 07:29:15 (GMT)
commit4ac7ed97a8cabb5dba6aa25e32cd59d9854dda90 (patch)
tree80294759ce4fdeca3751c1b69348b79255b0623e /Lib/test/test_httplib.py
parent1e40f10886f1c83e47f69ab229b27ab2eceff939 (diff)
downloadcpython-4ac7ed97a8cabb5dba6aa25e32cd59d9854dda90.zip
cpython-4ac7ed97a8cabb5dba6aa25e32cd59d9854dda90.tar.gz
cpython-4ac7ed97a8cabb5dba6aa25e32cd59d9854dda90.tar.bz2
Issue #22095: Fixed HTTPConnection.set_tunnel with default port. The port
value in the host header was set to "None". Patch by Demian Brecht.
Diffstat (limited to 'Lib/test/test_httplib.py')
-rw-r--r--Lib/test/test_httplib.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_httplib.py b/Lib/test/test_httplib.py
index 49d767d..d874339 100644
--- a/Lib/test/test_httplib.py
+++ b/Lib/test/test_httplib.py
@@ -1068,11 +1068,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', '/', '')