]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Merged revisions 87564 via svnmerge from
authorSenthil Kumaran <orsenthil@gmail.com>
Wed, 29 Dec 2010 06:30:19 +0000 (06:30 +0000)
committerSenthil Kumaran <orsenthil@gmail.com>
Wed, 29 Dec 2010 06:30:19 +0000 (06:30 +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 54be3373dc88b3d92836b8371cf8f880dc21f691..5866efc084cb1243a291acce3c4e8f405cfd69fc 100644 (file)
@@ -306,6 +306,10 @@ class UtilityTests(TestCase):
         self.checkReqURI("http://127.0.0.1/spam", SCRIPT_NAME="/spam")
         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 39e05f15ab59716e70fc586ea2991be0bfbdcfac..194b187a4dc8d6461f4ecfa8f1b438fccf7c3516 100644 (file)
@@ -64,7 +64,7 @@ def request_uri(environ, include_query=1):
     """Return the full request URI, optionally including the query string"""
     url = application_uri(environ)
     from urllib 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 da3928ee6b2d1de916c832c783d585b83aa689f3..7b32d670618c1cb4d8a07d880694251768c7d94c 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -22,6 +22,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