bradshjg / flask-githubapp

Flask extension for rapid Github app development in Python, in the spirit of probot (https://probot.github.io/)
MIT License
56 stars 14 forks source link

change context check in payload() #32

Closed theztefan closed 3 months ago

theztefan commented 3 months ago

👋 payload() method had a context check where it was searching for installation in the webhook payload delivered. This was failing on all webhook deliveries because the latest payloads do not include installation information in the payload itself. Switched the check to checking to a header X-GitHub-Hook-Installation-Target-ID sent with all webhooks.

Possibly want to extend to check for additional headers and validate the values in those headers

X-GitHub-Hook-ID: XXXXXXX
**X-GitHub-Hook-Installation-Target-ID: XXXXXXX**
X-GitHub-Hook-Installation-Target-Type: organization
theztefan commented 3 months ago

Ignore this PR. I wrongly assumed what the payload() method could be used for.