mirror of
https://github.com/jupyter/notebook.git
synced 2025-03-07 13:07:22 +08:00
Allow cross-origin patches for config
This commit is contained in:
parent
7a197feb33
commit
f2b42ae72c
@ -12,7 +12,7 @@ from ipython_genutils.py3compat import PY3
|
||||
from ...base.handlers import APIHandler, json_errors
|
||||
|
||||
class ConfigHandler(APIHandler):
|
||||
SUPPORTED_METHODS = ('GET', 'PUT', 'PATCH')
|
||||
SUPPORTED_METHODS = ('GET', 'PUT', 'PATCH', 'OPTIONS')
|
||||
|
||||
@web.authenticated
|
||||
@json_errors
|
||||
@ -34,6 +34,13 @@ class ConfigHandler(APIHandler):
|
||||
section = self.config_manager.update(section_name, new_data)
|
||||
self.finish(json.dumps(section))
|
||||
|
||||
@web.authenticated
|
||||
@json_errors
|
||||
def options(self, section_name):
|
||||
self.set_header('Access-Control-Allow-Headers', 'accept, content-type')
|
||||
self.set_header('Access-Control-Allow-Methods', 'GET, PUT, PATCH')
|
||||
self.finish()
|
||||
|
||||
|
||||
# URL to handler mappings
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user