Xia*_*ian 11 github jenkins ngrok jenkins-pipeline git-webhooks
我设置了localhost jenkins,使用ngrok将我的jenkins暴露给github.我没有设置任何凭据.当我从webhook测试传递时,它显示302未找到.响应:
Content-Length: 0
Date: Mon, 16 Apr 2018 02:09:22 GMT
Location: http://056b05cb.ngrok.io/github-webhook/
Server: Jetty(9.4.z-SNAPSHOT)
X-Content-Type-Options: nosniff
Run Code Online (Sandbox Code Playgroud)
请求:
Headers
Request URL: http://056b05cb.ngrok.io/github-webhook
Request method: POST
content-type: application/json
Expect:
User-Agent: GitHub-Hookshot/d5b13bc
X-GitHub-Delivery: bdc31e52-4115-11e8-9e6b-c7d083151290
X-GitHub-Event: push
Payload
{
"ref": "refs/heads/master",
"before": "14e1265dc10ef64c93ee7791db7fa9ccef63279f",
"after": "1f51b991d10af7c2b8fb4bc4c44417a57cf7bb56",
"created": false,
"deleted": false,
"forced": false,
"base_ref": null,
.....
}
Run Code Online (Sandbox Code Playgroud)
big*_*llm 31
刚被同一个问题击中.您似乎正在使用网址:http: //056b05cb.ngrok.io/github-webhook
只需将其切换到http://056b05cb.ngrok.io/github-webhook/(注意尾随/)
如果您在没有/浏览器的情况下点击网址,它将获得302,浏览器将只是重定向.但是webhook不遵循重定向,所以它只是告诉你响应是什么,这是302重定向.