mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 23:13:00 +00:00
Ensure request uri with trailing slash
When request uri matching with base_url in PrefixRedirectHandler, it's better to ensure uri with tariling slash. That's will avoid redirecting /foobar to /foobar/hub/foobar.
This commit is contained in:
@@ -901,6 +901,11 @@ class PrefixRedirectHandler(BaseHandler):
|
||||
"""
|
||||
def get(self):
|
||||
uri = self.request.uri
|
||||
# Since self.base_url will end with trailing slash.
|
||||
# Ensure uri will end with trailing slash when matching
|
||||
# with self.base_url.
|
||||
if not uri.endswith('/'):
|
||||
uri += '/'
|
||||
if uri.startswith(self.base_url):
|
||||
path = self.request.uri[len(self.base_url):]
|
||||
else:
|
||||
|
Reference in New Issue
Block a user