diff options
author | ianb <devnull@localhost> | 2005-05-17 00:12:23 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2005-05-17 00:12:23 +0000 |
commit | b24072bc3fc3082f3ad5ff0df3c5d16b01c01a4f (patch) | |
tree | 2c5e786c66bfccab2ae62dd3f6ea0d56b2187fc4 /paste/wsgilib.py | |
parent | a8e317c2979cbc9c8f2d4d35187da10098d2be8b (diff) | |
download | paste-b24072bc3fc3082f3ad5ff0df3c5d16b01c01a4f.tar.gz |
Added option for use when creating fully qualified base urls
Diffstat (limited to 'paste/wsgilib.py')
-rw-r--r-- | paste/wsgilib.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/paste/wsgilib.py b/paste/wsgilib.py index 216ed30..3bf5a6b 100644 --- a/paste/wsgilib.py +++ b/paste/wsgilib.py @@ -105,7 +105,7 @@ def interactive(*args, **kw): full.write(content) return full.getvalue() -def construct_url(environ, with_query_string=True): +def construct_url(environ, with_query_string=True, with_path_info=True): """ Reconstructs the URL from the WSGI environment. """ @@ -124,7 +124,8 @@ def construct_url(environ, with_query_string=True): url += ':' + environ['SERVER_PORT'] url += environ.get('SCRIPT_NAME','') - url += environ.get('PATH_INFO','') + if with_path_info: + url += environ.get('PATH_INFO','') if with_query_string: if environ.get('QUERY_STRING'): url += '?' + environ['QUERY_STRING'] |