From 3241405cefdb2cc545d689140728a5d22be7d18a Mon Sep 17 00:00:00 2001 From: Sri Sanketh Uppalapati Date: Sat, 12 Dec 2015 16:44:54 +0530 Subject: Update url.py --- pyramid/url.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pyramid/url.py b/pyramid/url.py index b004c40ec..210163fa5 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 -- cgit v1.2.3 From 55983f327b39bbf265b1ace1baac5a1f58c0f2fe Mon Sep 17 00:00:00 2001 From: Sri Sanketh Uppalapati Date: Sat, 12 Dec 2015 16:55:17 +0530 Subject: Update url.py --- pyramid/url.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyramid/url.py b/pyramid/url.py index 210163fa5..fd62f0057 100644 --- a/pyramid/url.py +++ b/pyramid/url.py @@ -106,7 +106,7 @@ class URLMethodsMixin(object): else: port = e['SERVER_PORT'] else: - port=str(port) + port = str(port) if ':' in host: host, _ = host.split(':', 1) if scheme == 'https': -- cgit v1.2.3 From 7682837de754c2515ff617a87afecae2498cfa6e Mon Sep 17 00:00:00 2001 From: Sri Sanketh Uppalapati Date: Sat, 12 Dec 2015 17:02:31 +0530 Subject: Update url.py --- pyramid/url.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyramid/url.py b/pyramid/url.py index fd62f0057..812514638 100644 --- a/pyramid/url.py +++ b/pyramid/url.py @@ -98,8 +98,6 @@ class URLMethodsMixin(object): port = '80' if host is None: host = e.get('HTTP_HOST') - if host is None: - host = e['SERVER_NAME'] if port is None: if ':' in host: host, port = host.split(':', 1) -- cgit v1.2.3 From b4fcff0471e16b6dab3a685df970bca712c5cb3b Mon Sep 17 00:00:00 2001 From: Sri Sanketh Uppalapati Date: Sat, 12 Dec 2015 17:06:29 +0530 Subject: Update url.py --- pyramid/url.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pyramid/url.py b/pyramid/url.py index 812514638..fd62f0057 100644 --- a/pyramid/url.py +++ b/pyramid/url.py @@ -98,6 +98,8 @@ class URLMethodsMixin(object): port = '80' if host is None: host = e.get('HTTP_HOST') + if host is None: + host = e['SERVER_NAME'] if port is None: if ':' in host: host, port = host.split(':', 1) -- cgit v1.2.3