From 43b73ddfc5f93c3066674ee636eb5baae799b35f Mon Sep 17 00:00:00 2001 From: Ville Rantanen Date: Mon, 19 Feb 2018 15:13:46 +0200 Subject: [PATCH] try adding address commonly --- code/app.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/code/app.py b/code/app.py index 070bf03..73340f8 100644 --- a/code/app.py +++ b/code/app.py @@ -107,8 +107,7 @@ def upload(name = None, password = None): "recipient": get_or_none(share,'recipient'), "share": name, "filename": filename, - "operation": "upload", - "address": request.remote_addr + "operation": "upload" }) if 'from_gui' in request.form: if request.form['from_gui'] == "true": @@ -190,8 +189,7 @@ def download_direct(name,password,filename): "recipient": get_or_none(share,'recipient'), "share": name, "filename": file_path, - "operation": "direct_download", - "address": request.remote_addr + "operation": "direct_download" }) return send_from_directory(directory=share['path'], filename=filename) @@ -211,8 +209,7 @@ def download_file(name,filename,password = None): "recipient": get_or_none(share,'recipient'), "share": name, "filename": file_path, - "operation": "download", - "address": request.remote_addr + "operation": "download" }) return send_from_directory(directory=share['path'], filename=filename) @@ -234,8 +231,7 @@ def download_zip(name,password = None): "recipient": get_or_none(share,'recipient'), "share": name, "filename": name + ".zip", - "operation": "zip_download", - "address": request.remote_addr + "operation": "zip_download" }) return send_file( zip_path, @@ -382,6 +378,10 @@ def makedirs_rights(path): def notify(msg): if 'notifier' in app.config: + msg['address'] = "%s:%s"%( + request.remote_addr, + request.environ['REMOTE_ADDR'] + ) app.config['notifier'].notify(msg)