mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-12 20:43:02 +00:00
strict host matching by including /
This commit is contained in:
@@ -40,10 +40,10 @@ class LoginHandler(BaseHandler):
|
||||
def get(self):
|
||||
self.statsd.incr('login.request')
|
||||
next_url = self.get_argument('next', '')
|
||||
if next_url.startswith('%s://%s' % (self.request.protocol, self.request.host)):
|
||||
if (next_url + '/').startswith('%s://%s/' % (self.request.protocol, self.request.host)):
|
||||
# treat absolute URLs for our host as absolute paths:
|
||||
next_url = urlparse(next_url).path
|
||||
if not next_url.startswith('/'):
|
||||
elif not next_url.startswith('/'):
|
||||
# disallow non-absolute next URLs (e.g. full URLs to other hosts)
|
||||
next_url = ''
|
||||
user = self.get_current_user()
|
||||
|
Reference in New Issue
Block a user