Skip to content

Commit 4b3f207

Browse files
committed
fix default_url redirect when base_url is defined
as it is, when base_url is set, default_url would redirect to itself, creating an infinite redirect loop. The condition is meant to prevent this loop when the default_url is the base_url, but base_url's default value was hardcoded in the check, causing the behavior to only be correct when base_url has this default value.
1 parent a837ae8 commit 4b3f207

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

jupyter_server/serverapp.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def init_handlers(self, default_services, settings):
332332
# register base handlers last
333333
handlers.extend(load_handlers('jupyter_server.base.handlers'))
334334

335-
if settings['default_url'] != '/':
335+
if settings['default_url'] != settings['base_url']:
336336
# set the URL that will be redirected from `/`
337337
handlers.append(
338338
(r'/?', RedirectWithParams, {

0 commit comments

Comments
 (0)