mirror of
https://github.com/jupyter/notebook.git
synced 2024-12-15 04:00:34 +08:00
Add the method to the correct base class
This commit is contained in:
parent
1f6a3700a2
commit
65eb248209
@ -386,6 +386,13 @@ class APIHandler(IPythonHandler):
|
||||
self.set_header('Content-Type', 'application/json')
|
||||
return super(APIHandler, self).finish(*args, **kwargs)
|
||||
|
||||
@web.authenticated
|
||||
def options(self, *args, **kwargs):
|
||||
self.set_header('Access-Control-Allow-Headers', 'accept, content-type')
|
||||
self.set_header('Access-Control-Allow-Methods',
|
||||
'GET, PUT, PATCH, DELETE, OPTIONS')
|
||||
self.finish()
|
||||
|
||||
|
||||
class Template404(IPythonHandler):
|
||||
"""Render our 404 template"""
|
||||
|
@ -18,13 +18,6 @@ class APIHandler(web.StaticFileHandler, IPythonHandler):
|
||||
self.set_header('Content-Type', 'text/x-yaml')
|
||||
return web.StaticFileHandler.get(self, 'api.yaml')
|
||||
|
||||
@web.authenticated
|
||||
def options(self, *args, **kwargs):
|
||||
self.set_header('Access-Control-Allow-Headers', 'accept, content-type')
|
||||
self.set_header('Access-Control-Allow-Methods',
|
||||
'GET, PUT, POST, PATCH, DELETE, OPTIONS')
|
||||
self.finish()
|
||||
|
||||
default_handlers = [
|
||||
(r"/api/spec.yaml", APIHandler)
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user