From 80932a51f462ef5190c5e982d6b66980b6cebabe Mon Sep 17 00:00:00 2001 From: YuviPanda Date: Thu, 31 Mar 2016 17:28:33 -0700 Subject: [PATCH] Use User.url instead of constructing it manually This fixes issues with URL encoding when redirecting users to their own notebook instances --- jupyterhub/handlers/base.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/jupyterhub/handlers/base.py b/jupyterhub/handlers/base.py index fcf4902c..c03cc36f 100644 --- a/jupyterhub/handlers/base.py +++ b/jupyterhub/handlers/base.py @@ -492,8 +492,7 @@ class UserSpawnHandler(BaseHandler): self.redirect(target) elif current_user: # logged in as a different user, redirect - target = url_path_join(self.base_url, 'user', current_user.name, - user_path or '') + target = url_path_join(current_user.url, user_path or '') self.redirect(target) else: # not logged in, clear any cookies and reload