Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{
'whitelist': voila_configuration.file_whitelist,
'blacklist': voila_configuration.file_blacklist,
'path': os.path.expanduser(web_app.settings['server_root_dir']),
},
),
])
# Serving notebook extensions
if voila_configuration.enable_nbextensions:
# First look into 'nbextensions_path' configuration key (classic notebook)
# and fall back to default path for nbextensions (jupyter server).
if 'nbextensions_path' in web_app.settings:
nbextensions_path = web_app.settings['nbextensions_path']
else:
nbextensions_path = jupyter_path('nbextensions')
web_app.add_handlers(host_pattern, [
# this handler serves the nbextensions similar to the classical notebook
(
url_path_join(base_url, r'/voila/nbextensions/(.*)'),
FileFindHandler,
{
'path': nbextensions_path,
'no_cache_paths': ['/'], # don't cache anything in nbextensions
},