Added ip override
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2020-05-14 22:37:30 +02:00
parent f5d293c11b
commit 35cce46eed

View File

@ -9,6 +9,14 @@ class SyncView(FlaskView):
def post(self): def post(self):
remote_uuid = request.json['uuid'] remote_uuid = request.json['uuid']
if 'ip' in request.json:
remote_ip = request.json['ip']
if request.remote_addr != remote_ip:
current_app.logger.debug(f"IP was overriden by the remote consumer {remote_ip} instead of {request.remote_addr}")
else:
remote_ip = request.remote_addr remote_ip = request.remote_addr
cust_key = f"consumer_{remote_uuid}" cust_key = f"consumer_{remote_uuid}"