fix: Use proxied IP address
All checks were successful
Build Docker / Build Image (push) Successful in 19s

This commit is contained in:
Nathan Woodburn 2023-11-07 23:14:36 +11:00
parent f1d1504657
commit 8ddb039ca4
Signed by: nathanwoodburn
GPG Key ID: 203B000478AD0EF1

View File

@ -31,6 +31,15 @@ def submit():
email = request.form['email'] email = request.form['email']
hidden = request.form['hi'] hidden = request.form['hi']
ip = request.remote_addr 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 == '': if hidden == '':
hidden = 'None' hidden = 'None'