summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Merickel <michael@merickel.org>2015-12-14 23:45:21 -0600
committerMichael Merickel <michael@merickel.org>2015-12-14 23:45:21 -0600
commit834a4372bc00cc56aa401efcbd5a4ae94acc9759 (patch)
tree5eba34de36680cf8e862b0c0681304dad1aabe09
parentf5846fd1b33a6512d2ec8b8127e6832fc0237fd2 (diff)
parentb4fcff0471e16b6dab3a685df970bca712c5cb3b (diff)
downloadpyramid-834a4372bc00cc56aa401efcbd5a4ae94acc9759.tar.gz
pyramid-834a4372bc00cc56aa401efcbd5a4ae94acc9759.tar.bz2
pyramid-834a4372bc00cc56aa401efcbd5a4ae94acc9759.zip
Merge pull request #2178 from srisankethu/patch-1
Update url.py
-rw-r--r--pyramid/url.py10
1 files changed, 4 insertions, 6 deletions
diff --git a/pyramid/url.py b/pyramid/url.py
index b004c40ec..fd62f0057 100644
--- a/pyramid/url.py
+++ b/pyramid/url.py
@@ -96,19 +96,17 @@ class URLMethodsMixin(object):
if scheme == 'http':
if port is None:
port = '80'
- url = scheme + '://'
- if port is not None:
- port = str(port)
if host is None:
host = e.get('HTTP_HOST')
- if host is None:
- host = e['SERVER_NAME']
+ if host is None:
+ host = e['SERVER_NAME']
if port is None:
if ':' in host:
host, port = host.split(':', 1)
else:
port = e['SERVER_PORT']
else:
+ port = str(port)
if ':' in host:
host, _ = host.split(':', 1)
if scheme == 'https':
@@ -117,7 +115,7 @@ class URLMethodsMixin(object):
elif scheme == 'http':
if port == '80':
port = None
- url += host
+ url = scheme + '://' + host
if port:
url += ':%s' % port