Skip to content
Browse files
Allow X-Forwarded-For
  • Loading branch information
Humbedooh committed Mar 27, 2022
1 parent a23ed41 commit 0ff682cf8dddc201cdd4ae53b0e0966641e9df4c
Showing 1 changed file with 1 addition and 1 deletion.
@@ -91,7 +91,7 @@ def main():

@app.route("/hook", methods=["POST", "PUT"])
def parse_request():
this_ip = netaddr.IPAddress(flask.request.remote_addr)
this_ip = netaddr.IPAddress(flask.request.headers.get("X-Forwarded-For") or flask.request.remote_addr)
allowed = any(this_ip in ip for ip in allowed_ips)
if not allowed:
return "No content\n"

0 comments on commit 0ff682c

Please sign in to comment.