mirror of
https://github.com/jupyter/notebook.git
synced 2025-01-12 11:45:38 +08:00
Allow access control headers to be overriden in jupyter_notebook_config.py
This commit is contained in:
parent
98085dcb84
commit
cc5e08d1bc
@ -607,8 +607,11 @@ class APIHandler(IPythonHandler):
|
||||
return super(APIHandler, self).finish(*args, **kwargs)
|
||||
|
||||
def options(self, *args, **kwargs):
|
||||
self.set_header('Access-Control-Allow-Headers',
|
||||
'accept, content-type, authorization, x-xsrftoken')
|
||||
if 'Access-Control-Allow-Headers' in self.settings.get('headers', {}):
|
||||
self.set_header('Access-Control-Allow-Headers', self.settings['headers']['Access-Control-Allow-Headers'])
|
||||
else:
|
||||
self.set_header('Access-Control-Allow-Headers',
|
||||
'accept, content-type, authorization, x-xsrftoken')
|
||||
self.set_header('Access-Control-Allow-Methods',
|
||||
'GET, PUT, POST, PATCH, DELETE, OPTIONS')
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user