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.
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):