diff options
| author | Sri Sanketh Uppalapati <sanketh.uppalapati@research.iiit.ac.in> | 2015-12-12 16:44:54 +0530 |
|---|---|---|
| committer | Sri Sanketh Uppalapati <sanketh.uppalapati@research.iiit.ac.in> | 2015-12-12 16:44:54 +0530 |
| commit | 3241405cefdb2cc545d689140728a5d22be7d18a (patch) | |
| tree | ae322576e1159e5f71a4d024d0a3afe58cd8ab7f | |
| parent | 6f34bf84917f72f464222dfa518d40300f67a365 (diff) | |
| download | pyramid-3241405cefdb2cc545d689140728a5d22be7d18a.tar.gz pyramid-3241405cefdb2cc545d689140728a5d22be7d18a.tar.bz2 pyramid-3241405cefdb2cc545d689140728a5d22be7d18a.zip | |
Update url.py
| -rw-r--r-- | pyramid/url.py | 10 |
1 files 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 |
