]> git.ipfire.org Git - thirdparty/tornado.git/commitdiff
Parse percent escapes in the path component of the uri, to be more
authorBen Darnell <bdarnell@beaker.local>
Fri, 9 Jul 2010 01:27:43 +0000 (18:27 -0700)
committerBen Darnell <bdarnell@beaker.local>
Fri, 9 Jul 2010 01:27:43 +0000 (18:27 -0700)
consistent with our handling of query parameters (especially important
when capturing groups are used in the URLSpec regex).

This change is slightly backwards-incompatible:  applications that have
already added an unquote() call on arguments to RequestHandler.get/post
or use percent escapes in URLSpec patterns will need to remove them.

tornado/httpserver.py

index ad7ab077aec6124396921d0a0298f0cd6928bf9f..4cd4c3f732efef67b4051e785326735dadaec569 100644 (file)
@@ -26,6 +26,7 @@ import logging
 import os
 import socket
 import time
+import urllib
 import urlparse
 
 try:
@@ -398,7 +399,8 @@ class HTTPRequest(object):
         self._finish_time = None
 
         scheme, netloc, path, query, fragment = urlparse.urlsplit(uri)
-        self.path = path
+        self.raw_path = path
+        self.path = urllib.unquote(path)
         self.query = query
         arguments = cgi.parse_qs(query)
         self.arguments = {}