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.
This commit is contained in:
parent
a6d158f155
commit
582106b93f
|
@ -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):
|
||||
|
|
Loading…
Reference in New Issue