mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 23:13:00 +00:00
Merge pull request #2648 from nicorikken/feature/debug-403-error
fix: spawn redirect for users whose names need escaping
This commit is contained in:
@@ -62,9 +62,9 @@ class HomeHandler(BaseHandler):
|
||||
# to establish that this is an explicit spawn request rather
|
||||
# than an implicit one, which can be caused by any link to `/user/:name(/:server_name)`
|
||||
if user.active:
|
||||
url = url_path_join(self.base_url, 'user', user.name)
|
||||
url = url_path_join(self.base_url, 'user', user.escaped_name)
|
||||
else:
|
||||
url = url_path_join(self.hub.base_url, 'spawn', user.name)
|
||||
url = url_path_join(self.hub.base_url, 'spawn', user.escaped_name)
|
||||
|
||||
html = self.render_template(
|
||||
'home.html',
|
||||
@@ -133,7 +133,7 @@ class SpawnHandler(BaseHandler):
|
||||
# which may get handled by the default server if they aren't ready yet
|
||||
|
||||
pending_url = url_path_join(
|
||||
self.hub.base_url, "spawn-pending", user.name, server_name
|
||||
self.hub.base_url, "spawn-pending", user.escaped_name, server_name
|
||||
)
|
||||
|
||||
if self.get_argument('next', None):
|
||||
@@ -220,7 +220,7 @@ class SpawnHandler(BaseHandler):
|
||||
next_url = self.get_next_url(
|
||||
user,
|
||||
default=url_path_join(
|
||||
self.hub.base_url, "spawn-pending", user.name, server_name
|
||||
self.hub.base_url, "spawn-pending", user.escaped_name, server_name
|
||||
),
|
||||
)
|
||||
self.redirect(next_url)
|
||||
|
Reference in New Issue
Block a user