Skip to content

Commit 2431d38

Browse files
committed
Support serving kernelspec resources
A long-standing TODO item for NB2KG was to add support for kernelspec resources (kernel.js, kernel.css and logo-*). This can't be accomplished until JKG provides the endpoint such that specific resources can be fetched.
1 parent 522b4fc commit 2431d38

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel_gateway/services/kernelspecs/handlers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
"""Tornado handlers for kernel specs."""
44

55
import notebook.services.kernelspecs.handlers as notebook_handlers
6+
import notebook.kernelspecs.handlers as notebook_kernelspecs_resources_handlers
7+
68
from ...mixins import TokenAuthorizationMixin, CORSMixin, JSONErrorsMixin
79

810
# Extends the default handlers from the notebook package with token auth, CORS
@@ -12,3 +14,8 @@
1214
# Everything should have CORS and token auth
1315
bases = (TokenAuthorizationMixin, CORSMixin, JSONErrorsMixin, cls)
1416
default_handlers.append((path, type(cls.__name__, bases, {})))
17+
18+
for path, cls in notebook_kernelspecs_resources_handlers.default_handlers:
19+
# Everything should have CORS and token auth
20+
bases = (TokenAuthorizationMixin, CORSMixin, JSONErrorsMixin, cls)
21+
default_handlers.append((path, type(cls.__name__, bases, {})))

0 commit comments

Comments
 (0)