use X-Gitea-Event-Type for event type match

Addresses the duplicate events mentioned in issue #2
This commit is contained in:
Morgan McMillian 2022-06-24 22:29:54 -07:00
parent bbaac5a85c
commit a2740624cd

View file

@ -33,7 +33,7 @@ srht_public_key = Ed25519PublicKey.from_public_bytes(
def gitea_event(gateway=None): def gitea_event(gateway=None):
secret = bytes(config["gitea_secret"], "utf-8") secret = bytes(config["gitea_secret"], "utf-8")
signature = request.headers["X-Gitea-Signature"] signature = request.headers["X-Gitea-Signature"]
event = request.headers["X-Gitea-Event"] event = request.headers["X-Gitea-Event-Type"]
sigcheck = hmac.new(secret, msg=request.data, digestmod=hashlib.sha256).hexdigest() sigcheck = hmac.new(secret, msg=request.data, digestmod=hashlib.sha256).hexdigest()