Skip to content

Commit 872a6c7

Browse files
authored
Merge pull request #3886 from rwmajor2/add_access_control_hdr_config
Allow access control headers to be overriden in jupyter_notebook_conf…
2 parents 0abc822 + cc5e08d commit 872a6c7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

notebook/base/handlers.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -607,8 +607,11 @@ def finish(self, *args, **kwargs):
607607
return super(APIHandler, self).finish(*args, **kwargs)
608608

609609
def options(self, *args, **kwargs):
610-
self.set_header('Access-Control-Allow-Headers',
611-
'accept, content-type, authorization, x-xsrftoken')
610+
if 'Access-Control-Allow-Headers' in self.settings.get('headers', {}):
611+
self.set_header('Access-Control-Allow-Headers', self.settings['headers']['Access-Control-Allow-Headers'])
612+
else:
613+
self.set_header('Access-Control-Allow-Headers',
614+
'accept, content-type, authorization, x-xsrftoken')
612615
self.set_header('Access-Control-Allow-Methods',
613616
'GET, PUT, POST, PATCH, DELETE, OPTIONS')
614617

0 commit comments

Comments
 (0)