Skip to content

Commit 6ce6201

Browse files
committed
Use base_url so that the extension works in a JupyterHub setting.
1 parent d994409 commit 6ce6201

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

jupyterlab_github/__init__.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,5 +100,7 @@ def load_jupyter_server_extension(nb_server_app):
100100
nb_server_app (NotebookWebApplication): handle to the Notebook webserver instance.
101101
"""
102102
web_app = nb_server_app.web_app
103-
host_pattern = '.*$'
104-
web_app.add_handlers(host_pattern, [(r'/github%s' % path_regex, GitHubHandler)])
103+
base_url = web_app.settings['base_url']
104+
endpoint = url_path_join(base_url, 'github')
105+
handlers = [(endpoint + "(.*)", GitHubHandler)]
106+
web_app.add_handlers('.*$', handlers)

0 commit comments

Comments
 (0)