From: Ben Darnell Date: Mon, 13 May 2013 04:08:04 +0000 (-0400) Subject: Remove whitespace/control-character check from RequestHandler.redirect. X-Git-Tag: v3.1.0~76^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=582106b93f80b715ee3bccc039fb2b8299c21fb6;p=thirdparty%2Ftornado.git Remove whitespace/control-character check from RequestHandler.redirect. Control characters (and newlines and tabs) will be caught in set_header (which will raise an exception instead of silently stripping them). Spaces will now be allowed through, producing invalid urls, but at least they won't mess up the header framing. Closes #617. --- diff --git a/tornado/web.py b/tornado/web.py index 905621c21..af5ea5127 100644 --- a/tornado/web.py +++ b/tornado/web.py @@ -500,10 +500,8 @@ class RequestHandler(object): else: assert isinstance(status, int) and 300 <= status <= 399 self.set_status(status) - # Remove whitespace - url = re.sub(br"[\x00-\x20]+", "", utf8(url)) self.set_header("Location", urlparse.urljoin(utf8(self.request.uri), - url)) + utf8(url))) self.finish() def write(self, chunk):