Skip to content

Commit

Permalink
Merge pull request #3886 from rwmajor2/add_access_control_hdr_config
Browse files Browse the repository at this point in the history
Allow access control headers to be overriden in jupyter_notebook_conf…
  • Loading branch information
minrk authored Sep 7, 2018
2 parents 0abc822 + cc5e08d commit 872a6c7
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 872a6c7

Please sign in to comment.