Commit 7425ba57 authored by Jogi Hofmüller's avatar Jogi Hofmüller

Add methods get() and options() to RestHandler

parent 00c230fa
......@@ -93,20 +93,22 @@ class RestHandler(tornado.web.RequestHandler):
def put(self, *args):
pass
@tornado.web.asynchronous
def get(self):
pass
def options(self):
self.set_status(204)
self.finish()
class GeruechtHandler(RestHandler):
def set_default_headers(self):
self.set_header('Access-Control-Allow-Origin', '*')
self.set_header('Access-Control-Allow-Origin', frontendurl)
self.set_header('Access-Control-Allow-Credentials', 'true')
self.set_header('Access-Control-Allow-Methods', 'GET')
@tornado.web.asynchronous
def get(self):
# cookie first ...
if not self.get_cookie('user'):
self.set_cookie('user', 'anonymous')
logmsg('set anonymous cookie')
else:
logmsg('cookie found')
geruecht = gdb.getNextGeruecht()
if not geruecht:
data = {'status': 'error'}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment