From 8122da5775577faad229f9febc2838d4af3425b4 Mon Sep 17 00:00:00 2001 From: ianb Date: Mon, 18 Dec 2006 19:12:00 +0000 Subject: Quote SCRIPT_NAME and PATH_INFO in construct_url and when forwarding the request via the proxy --- paste/request.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'paste/request.py') 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'): -- cgit v1.2.1