Add the method to the correct base class

Steven Silvester 11 years ago
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…
Cancel
Save