changeset 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 983bb4069004
children ab3cf67740d6
files mercurial/url.py
diffstat 1 files changed, 7 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/url.py	Fri Jul 19 02:08:19 2013 +0400
+++ b/mercurial/url.py	Sat Aug 03 13:23:48 2013 -0500
@@ -108,8 +108,13 @@
 
     def proxy_open(self, req, proxy, type_):
         host = req.get_host().split(':')[0]
-        if host in self.no_list:
-            return None
+        for e in self.no_list:
+            if host == e:
+                return None
+            if e.startswith('*.') and host.endswith(e[2:]):
+                return None
+            if e.startswith('.') and host.endswith(e[1:]):
+                return None
 
         # work around a bug in Python < 2.4.2
         # (it leaves a "\n" at the end of Proxy-authorization headers)