add / to user-redirect

Some proxies may not correctly route /user/name, only /user/name/...
This commit is contained in:
Min RK
2017-08-07 15:23:58 +02:00
parent 6ba3090cd5
commit 546268809f
2 changed files with 3 additions and 1 deletions

View File

@@ -631,6 +631,8 @@ class UserSpawnHandler(BaseHandler):
@gen.coroutine
def get(self, name, user_path):
if not user_path:
user_path = '/'
current_user = self.get_current_user()
if current_user and current_user.name == name:

View File

@@ -218,7 +218,7 @@ def test_user_redirect_deprecated(app):
r.raise_for_status()
print(urlparse(r.url))
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.raise_for_status()