Commit f73c3e5f authored by Jogi Hofmüller's avatar Jogi Hofmüller

Log remote ip, origin and referer

parent 93759c83
......@@ -105,11 +105,13 @@ class GeruechtHandler(RestHandler):
geruecht = gdb.getNextGeruecht()
if not geruecht:
data = {'status': 'error'}
logmsg('GeruechtHandler: error')
logmsg('GeruechtHandler: error remote_ip={}, referer={}, origin={}'.format(
self.request.remote_ip, self.request.headers['Referer'], self.request.headers['Origin']))
else:
data = {'status': 'success', 'payload': geruecht}
# here we will display the client's ip address
logmsg('GeruechtHandler: served geruecht')
logmsg('GeruechtHandler: served geruecht to remote_ip={}, referer={}, origin={}'.format(
self.request.remote_ip, self.request.headers['Referer'], self.request.headers['Origin']))
data = json.dumps(data)
self.finish(data)
......
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