protect against some browsers' buggy handling of backslash as slash

This commit is contained in:
Min RK
2019-03-28 10:30:36 +01:00
parent 2a23e8afea
commit 6e14e86a1a

View File

@@ -549,6 +549,8 @@ class BaseHandler(RequestHandler):
- else: /hub/home
"""
next_url = self.get_argument('next', default='')
# protect against some browsers' buggy handling of backslash as slash
next_url = next_url.replace('\\', '%5C')
if (next_url + '/').startswith(
(
'%s://%s/' % (self.request.protocol, self.request.host),