Add the method to the correct base class

This commit is contained in:
Steven Silvester 2015-09-24 16:21:52 -05:00
parent 1f6a3700a2
commit 65eb248209
2 changed files with 7 additions and 7 deletions

View File

@ -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"""

View File

@ -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)
]