diff --git a/VERSION b/VERSION index e1c3cfc0..b5fb6ffd 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -Version 2.0.6 (2012-09-02 11:05:13) stable +Version 2.0.6 (2012-09-02 11:12:42) stable diff --git a/gluon/rewrite.py b/gluon/rewrite.py index 8d124670..c7a1b211 100644 --- a/gluon/rewrite.py +++ b/gluon/rewrite.py @@ -38,6 +38,7 @@ thread = threading.local() # thread-local storage for routing params regex_at = re.compile(r'(?(.*)') +regex_full_url = re.compile(r'^(?Phttp|https|HTTP|HTTPS)\://(?P[^/]*)(?P.*)') def _router_default(): "return new copy of default base router" @@ -695,11 +696,14 @@ def regex_filter_out(url, e=None): return url -def filter_url(url, method='get', remote='0.0.0.0', out=False, app=False, lang=None, - domain=(None,None), env=False, scheme=None, host=None, port=None): - "doctest/unittest interface to regex_filter_in() and regex_filter_out()" - regex_url = re.compile(r'^(?Phttp|https|HTTP|HTTPS)\://(?P[^/]*)(?P.*)') - match = regex_url.match(url) +def filter_url(url, method='get', remote='0.0.0.0', + out=False, app=False, lang=None, + domain=(None,None), env=False, scheme=None, + host=None, port=None): + """ + doctest/unittest interface to regex_filter_in() and regex_filter_out() + """ + match = regex_full_url.match(url) urlscheme = match.group('scheme').lower() urlhost = match.group('host').lower() uri = match.group('uri')