summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2013-11-12 00:24:08 -0600
committerMichael Merickel <michael@merickel.org>2013-11-12 00:24:08 -0600
commit093127f6f0492343521d6a07475178c0efb0fd98 (patch)
treea0182ae30ead3c8cf96ccd943983b9d5a6cd3e6c
parent70381b1ac56348c025261f1e7300e0b63891d363 (diff)
downloadpyramid-093127f6f0492343521d6a07475178c0efb0fd98.tar.gz
pyramid-093127f6f0492343521d6a07475178c0efb0fd98.tar.bz2
pyramid-093127f6f0492343521d6a07475178c0efb0fd98.zip
remove need for parsing static url twice to replace scheme
-rw-r--r--pyramid/config/views.py6
1 files 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: