]> granicus.if.org Git - python/commitdiff
Merged revisions 87564 via svnmerge from
authorSenthil Kumaran <orsenthil@gmail.com>
Wed, 29 Dec 2010 06:29:58 +0000 (06:29 +0000)
committerSenthil Kumaran <orsenthil@gmail.com>
Wed, 29 Dec 2010 06:29:58 +0000 (06:29 +0000)
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
Lib/wsgiref/util.py
Misc/NEWS

index 0b1a6373824fee0f3e5dc8b57439ce324169b2a5..ef38d77821a09a03b87232772a7733888fcdd336 100755 (executable)
@@ -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,
index 00d1f26313e1ef64dd0d26907ab03ba36ecf54ca..06eb956fdfce8406e763ab499086bc3de06fd8de 100644 (file)
@@ -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:
index 296639cf760c02bcbb74d5b89f6aae9cf9d96867..340fc124d6567c540a3b6cf8acb1554f8bc8da9d 100644 (file)
--- 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