commit | 0ff682cf8dddc201cdd4ae53b0e0966641e9df4c | [log] [tgz] |
---|---|---|
author | Daniel Gruno <humbedooh@apache.org> | Sun Mar 27 15:13:19 2022 +0200 |
committer | GitHub <noreply@github.com> | Sun Mar 27 15:13:19 2022 +0200 |
tree | 2584a43850eec4ae4fa03452a8158d0f75015348 | |
parent | a23ed41c7e3efc32bc1c0d4c9a6d843a8f79e69b [diff] |
Allow X-Forwarded-For
diff --git a/ghactions.py b/ghactions.py index 77ca386..442dd93 100644 --- a/ghactions.py +++ b/ghactions.py
@@ -91,7 +91,7 @@ @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"