anti-spam

This commit is contained in:
Yax 2018-01-28 18:12:53 +01:00
parent 18b879be14
commit 03b411e433
2 changed files with 25 additions and 1 deletions

View file

@ -16,7 +16,13 @@ def new_form_comment():
try:
data = request.form
# add client IP if provided by HTTP proxy
logger.info('headers: {}'.format(request.headers))
if 'X-Forwarded-For' in request.headers:
data['clientip'] = request.headers['X-Forwarded-For']
# log
logger.info(data)
# validate token: retrieve site entity