From 093127f6f0492343521d6a07475178c0efb0fd98 Mon Sep 17 00:00:00 2001 From: Michael Merickel Date: Tue, 12 Nov 2013 00:24:08 -0600 Subject: remove need for parsing static url twice to replace scheme --- pyramid/config/views.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pyramid/config/views.py b/pyramid/config/views.py index 0a47d869a..5ad235795 100644 --- a/pyramid/config/views.py +++ b/pyramid/config/views.py @@ -1902,10 +1902,8 @@ class StaticURLInfo(object): else: parsed = url_parse(url) if not parsed.scheme: - # parsed.scheme is readonly, so we have to parse again - # to change the scheme, sigh. - url = urlparse.urlunparse(url_parse( - url, scheme=request.environ['wsgi.url_scheme'])) + url = urlparse.urlunparse(parsed._replace( + scheme=request.environ['wsgi.url_scheme'])) subpath = url_quote(subpath) result = urljoin(url, subpath) if '_query' in kw: -- cgit v1.2.3