From: Ben Darnell Date: Fri, 9 Jul 2010 01:27:43 +0000 (-0700) Subject: Parse percent escapes in the path component of the uri, to be more X-Git-Tag: v1.0.0~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7b80c2f4db226d6fa3a7f3dfa59277da1d642f91;p=thirdparty%2Ftornado.git Parse percent escapes in the path component of the uri, to be more 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. --- diff --git a/tornado/httpserver.py b/tornado/httpserver.py index ad7ab077a..4cd4c3f73 100644 --- a/tornado/httpserver.py +++ b/tornado/httpserver.py @@ -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 = {}