From: Gui Chen Date: Tue, 14 Jan 2014 05:44:04 +0000 (-0500) Subject: fix single ip ignored in no proxy setting X-Git-Tag: 0.24~21 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7a3e7c77495b469dccec68a480f2c161980912c1;p=tools%2Fmic.git fix single ip ignored in no proxy setting Fixes: #1569 Change-Id: Ic40c32ceaed78e59947af7f185e00e84ccbb30b8 Signed-off-by: Gui Chen --- diff --git a/mic/utils/proxy.py b/mic/utils/proxy.py index 91451a2..c1fb94f 100644 --- a/mic/utils/proxy.py +++ b/mic/utils/proxy.py @@ -16,6 +16,7 @@ # Temple Place - Suite 330, Boston, MA 02111-1307, USA. import os +import re import urlparse _my_proxies = {} @@ -145,7 +146,7 @@ def _isnoproxy(url): hostisip = _isip(host) for item in _my_noproxy_list: - if hostisip and item["match"] <= 1: + if hostisip and item["match"] == 1: continue if item["match"] == 2 and hostisip: @@ -157,7 +158,7 @@ def _isnoproxy(url): return True if item["match"] == 1: - if host.rfind(item["needle"]) > 0: + if re.match(r".*%s$" % item["needle"], host): return True return False