mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 06:52:59 +00:00
add / to user-redirect
Some proxies may not correctly route /user/name, only /user/name/...
This commit is contained in:
@@ -631,6 +631,8 @@ class UserSpawnHandler(BaseHandler):
|
|||||||
|
|
||||||
@gen.coroutine
|
@gen.coroutine
|
||||||
def get(self, name, user_path):
|
def get(self, name, user_path):
|
||||||
|
if not user_path:
|
||||||
|
user_path = '/'
|
||||||
current_user = self.get_current_user()
|
current_user = self.get_current_user()
|
||||||
|
|
||||||
if current_user and current_user.name == name:
|
if current_user and current_user.name == name:
|
||||||
|
@@ -218,7 +218,7 @@ def test_user_redirect_deprecated(app):
|
|||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
print(urlparse(r.url))
|
print(urlparse(r.url))
|
||||||
path = urlparse(r.url).path
|
path = urlparse(r.url).path
|
||||||
assert path == ujoin(app.base_url, '/user/%s' % name)
|
assert path == ujoin(app.base_url, '/user/%s/' % name)
|
||||||
|
|
||||||
r = yield get_page('/user/baduser/test.ipynb', app, cookies=cookies, hub=False)
|
r = yield get_page('/user/baduser/test.ipynb', app, cookies=cookies, hub=False)
|
||||||
r.raise_for_status()
|
r.raise_for_status()
|
||||||
|
Reference in New Issue
Block a user