diff options
author | ianb <devnull@localhost> | 2007-01-04 00:37:19 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2007-01-04 00:37:19 +0000 |
commit | c62be0146584cfd63105ea6e68c2de188e835cce (patch) | |
tree | 9c13d2149e534860fd8609f3f6f46906f6efdc05 /paste/request.py | |
parent | e52a896bdc0d9bad912b2f96da97d90bea8b904c (diff) | |
download | paste-c62be0146584cfd63105ea6e68c2de188e835cce.tar.gz |
Respect HTTP_HOST over SERVER_PORT in construct_url
Diffstat (limited to 'paste/request.py')
-rw-r--r-- | paste/request.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/paste/request.py b/paste/request.py index 24de9b8..cc9bf00 100644 --- a/paste/request.py +++ b/paste/request.py @@ -202,16 +202,15 @@ def construct_url(environ, with_query_string=True, with_path_info=True, url = environ['wsgi.url_scheme']+'://' if environ.get('HTTP_HOST'): - url += environ['HTTP_HOST'].split(':')[0] + url += environ['HTTP_HOST'].split(':') else: url += environ['SERVER_NAME'] - - if environ['wsgi.url_scheme'] == 'https': - if environ['SERVER_PORT'] != '443': - url += ':' + environ['SERVER_PORT'] - else: - if environ['SERVER_PORT'] != '80': - url += ':' + environ['SERVER_PORT'] + if environ['wsgi.url_scheme'] == 'https': + if environ['SERVER_PORT'] != '443': + url += ':' + environ['SERVER_PORT'] + else: + if environ['SERVER_PORT'] != '80': + url += ':' + environ['SERVER_PORT'] if script_name is None: url += urllib.quote(environ.get('SCRIPT_NAME','')) |