Mercurial > public > mercurial-scm > hg
comparison mercurial/url.py @ 19535:df2155ebf502
proxy: allow wildcards in the no proxy list (issue1821)
author | Matt Mackall <mpm@selenic.com> |
---|---|
date | Sat, 03 Aug 2013 13:23:48 -0500 |
parents | ffec6d0a5ed6 |
children | 181108726ea5 |
comparison
equal
deleted
inserted
replaced
19534:983bb4069004 | 19535:df2155ebf502 |
---|---|
106 urllib2.ProxyHandler.__init__(self, proxies) | 106 urllib2.ProxyHandler.__init__(self, proxies) |
107 self.ui = ui | 107 self.ui = ui |
108 | 108 |
109 def proxy_open(self, req, proxy, type_): | 109 def proxy_open(self, req, proxy, type_): |
110 host = req.get_host().split(':')[0] | 110 host = req.get_host().split(':')[0] |
111 if host in self.no_list: | 111 for e in self.no_list: |
112 return None | 112 if host == e: |
113 return None | |
114 if e.startswith('*.') and host.endswith(e[2:]): | |
115 return None | |
116 if e.startswith('.') and host.endswith(e[1:]): | |
117 return None | |
113 | 118 |
114 # work around a bug in Python < 2.4.2 | 119 # work around a bug in Python < 2.4.2 |
115 # (it leaves a "\n" at the end of Proxy-authorization headers) | 120 # (it leaves a "\n" at the end of Proxy-authorization headers) |
116 baseclass = req.__class__ | 121 baseclass = req.__class__ |
117 class _request(baseclass): | 122 class _request(baseclass): |