aboutsummaryrefslogtreecommitdiff
path: root/hex_zero.py
diff options
context:
space:
mode:
Diffstat (limited to 'hex_zero.py')
-rwxr-xr-xhex_zero.py9
1 files changed, 6 insertions, 3 deletions
diff --git a/hex_zero.py b/hex_zero.py
index 81c8169..b534a51 100755
--- a/hex_zero.py
+++ b/hex_zero.py
@@ -382,9 +382,12 @@ def fhost():
out = None
if "file" in request.files:
- if app.config["USE_HTTP_X_FORWARDED_FOR"]:
- stored_ip_address = request.environ["HTTP_X_FORWARDED_FOR"]
- else:
+ try:
+ if app.config["USE_HTTP_X_FORWARDED_FOR"]:
+ stored_ip_address = request.environ["HTTP_X_FORWARDED_FOR"]
+ else:
+ stored_ip_address = request.remote_addr
+ except:
stored_ip_address = request.remote_addr
out = store_file(request.files["file"], stored_ip_address)
elif "url" in request.form:
bgstack15