From 8ddb039ca438b0291cad8ef5101d4b8bba466eb8 Mon Sep 17 00:00:00 2001 From: Nathan Woodburn Date: Tue, 7 Nov 2023 23:14:36 +1100 Subject: [PATCH] fix: Use proxied IP address --- main.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.py b/main.py index 4ba7c45..3be030c 100644 --- a/main.py +++ b/main.py @@ -31,6 +31,15 @@ def submit(): email = request.form['email'] hidden = request.form['hi'] ip = request.remote_addr + + if 'X-REAL-IP' in request.headers: + print("X-REAL-IP",flush=True) + ip = request.headers['X-REAL-IP'] + + if 'X-Real-Ip' in request.headers: + print("X-Real-Ip2",flush=True) + ip = request.headers['X-Real-Ip'] + if hidden == '': hidden = 'None'