How to verify a post-receive hook request actually came from github?

前端 未结 5 1519
不知归路
不知归路 2020-12-08 16:19

Github offers a way to let a URL know when a project has been updated using webhooks.

How do I verify that a post sent to my server\'s post-receive hook act

5条回答
  •  执念已碎
    2020-12-08 17:02

    You can ping GitHub's Meta API to get an array of IP addresses (in CIDR notation) that the incoming service hooks will originate from and cross check them against the request's IP :

    https://api.github.com/meta

提交回复
热议问题