Merge pull request #2648 from nicorikken/feature/debug-403-error

fix: spawn redirect for users whose names need escaping
This commit is contained in:
Min RK
2019-07-22 14:49:57 +02:00
committed by GitHub
2 changed files with 10 additions and 7 deletions

View File

@@ -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)