From e5f8e849c8b11acc7890425fcba051647d7bb35d Mon Sep 17 00:00:00 2001 From: Senthil Kumaran Date: Wed, 29 Dec 2010 06:29:58 +0000 Subject: [PATCH] Merged revisions 87564 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r87564 | senthil.kumaran | 2010-12-29 14:25:42 +0800 (Wed, 29 Dec 2010) | 3 lines Fix Issue 10753 - Don't quote ;=, in the PATH_INFO envvar. ........ --- Lib/test/test_wsgiref.py | 4 ++++ Lib/wsgiref/util.py | 2 +- Misc/NEWS | 5 +++++ 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_wsgiref.py b/Lib/test/test_wsgiref.py index 0b1a6373824..ef38d77821a 100755 --- a/Lib/test/test_wsgiref.py +++ b/Lib/test/test_wsgiref.py @@ -342,6 +342,10 @@ class UtilityTests(TestCase): self.checkReqURI("http://127.0.0.1/sp%C3%A4m", SCRIPT_NAME="/späm") self.checkReqURI("http://127.0.0.1/spammity/spam", SCRIPT_NAME="/spammity", PATH_INFO="/spam") + self.checkReqURI("http://127.0.0.1/spammity/spam;ham", + SCRIPT_NAME="/spammity", PATH_INFO="/spam;ham") + self.checkReqURI("http://127.0.0.1/spammity/spam;cookie=1234,5678", + SCRIPT_NAME="/spammity", PATH_INFO="/spam;cookie=1234,5678") self.checkReqURI("http://127.0.0.1/spammity/spam?say=ni", SCRIPT_NAME="/spammity", PATH_INFO="/spam",QUERY_STRING="say=ni") self.checkReqURI("http://127.0.0.1/spammity/spam", 0, diff --git a/Lib/wsgiref/util.py b/Lib/wsgiref/util.py index 00d1f26313e..06eb956fdfc 100644 --- a/Lib/wsgiref/util.py +++ b/Lib/wsgiref/util.py @@ -71,7 +71,7 @@ def request_uri(environ, include_query=True): """Return the full request URI, optionally including the query string""" url = application_uri(environ) from urllib.parse import quote - path_info = quote(environ.get('PATH_INFO','')) + path_info = quote(environ.get('PATH_INFO',''),safe='/;=,') if not environ.get('SCRIPT_NAME'): url += path_info[1:] else: diff --git a/Misc/NEWS b/Misc/NEWS index 296639cf760..340fc124d65 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -24,6 +24,11 @@ Core and Builtins Library ------- +- Issue 10753 - Characters ';','=' and ',' in the PATH_INFO environment + variable won't be quoted when the URI is constructed by the wsgiref.util 's + request_uri method. According to RFC 3986, these characters can be a part of + params in PATH component of URI and need not be quoted. + - Issue 10738: Fix webbrowser.Opera.raise_opts - Issue 9824: SimpleCookie now encodes , and ; in values to cater to how