Skip to content

Commit

Permalink
Allow access control headers to be overriden in jupyter_notebook_conf…
Browse files Browse the repository at this point in the history
…ig.py
  • Loading branch information
Bill Major committed Aug 28, 2018
1 parent 98085dc commit cc5e08d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions notebook/base/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,8 +607,11 @@ def finish(self, *args, **kwargs):
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')

Expand Down

0 comments on commit cc5e08d

Please sign in to comment.