mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #26864: Merge no_proxy fixes from 3.5
This commit is contained in:
commit
51b697b7f3
3 changed files with 24 additions and 2 deletions
|
@ -231,6 +231,19 @@ class ProxyTests(unittest.TestCase):
|
|||
self.assertTrue(urllib.request.proxy_bypass_environment('anotherdomain.com:8888'))
|
||||
self.assertTrue(urllib.request.proxy_bypass_environment('newdomain.com:1234'))
|
||||
|
||||
def test_proxy_bypass_environment_host_match(self):
|
||||
bypass = urllib.request.proxy_bypass_environment
|
||||
self.env.set('NO_PROXY',
|
||||
'localhost, anotherdomain.com, newdomain.com:1234')
|
||||
self.assertTrue(bypass('localhost'))
|
||||
self.assertTrue(bypass('LocalHost')) # MixedCase
|
||||
self.assertTrue(bypass('LOCALHOST')) # UPPERCASE
|
||||
self.assertTrue(bypass('newdomain.com:1234'))
|
||||
self.assertTrue(bypass('anotherdomain.com:8888'))
|
||||
self.assertTrue(bypass('www.newdomain.com:1234'))
|
||||
self.assertFalse(bypass('prelocalhost'))
|
||||
self.assertFalse(bypass('newdomain.com')) # no port
|
||||
self.assertFalse(bypass('newdomain.com:1235')) # wrong port
|
||||
|
||||
class ProxyTests_withOrderedEnv(unittest.TestCase):
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue