diff options
author | ianb <devnull@localhost> | 2006-12-18 19:12:00 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-12-18 19:12:00 +0000 |
commit | 8122da5775577faad229f9febc2838d4af3425b4 (patch) | |
tree | bc0717f08f0e25ece8445b9c97a6f83f1528e541 /paste/request.py | |
parent | 7b8dc91c464ac3a770140b26d4e6cc351bafba0d (diff) | |
download | paste-8122da5775577faad229f9febc2838d4af3425b4.tar.gz |
Quote SCRIPT_NAME and PATH_INFO in construct_url and when forwarding the request via the proxy
Diffstat (limited to 'paste/request.py')
-rw-r--r-- | paste/request.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/paste/request.py b/paste/request.py index 30b209c..3bbca44 100644 --- a/paste/request.py +++ b/paste/request.py @@ -21,6 +21,7 @@ import cgi from Cookie import SimpleCookie from StringIO import StringIO import urlparse +import urllib try: from UserDict import DictMixin except ImportError: @@ -213,14 +214,14 @@ def construct_url(environ, with_query_string=True, with_path_info=True, url += ':' + environ['SERVER_PORT'] if script_name is None: - url += environ.get('SCRIPT_NAME','') + url += urllib.quote(environ.get('SCRIPT_NAME','')) else: - url += script_name + url += urllib.quote(script_name) if with_path_info: if path_info is None: - url += environ.get('PATH_INFO','') + url += urllib.quote(environ.get('PATH_INFO','')) else: - url += path_info + url += urllib.quote(path_info) if with_query_string: if querystring is None: if environ.get('QUERY_STRING'): |