【问题标题】:How to add header (for jenkins crumb) to github webook?如何将标头(用于 jenkins crumb)添加到 github webhook?
【发布时间】:2020-02-02 18:15:30
【问题描述】:

我们正在尝试设置一个 webhook,以便我们可以使用 https://github.com/blar/blar/settings/hooks 在我们可公开访问的 Jenkins 服务器上触发作业

表单为我们提供了“有效负载 URL”字段,但没有提供额外标题的字段。这意味着我们不能提供 Jenkins crumb 以便请求可以正确地进行身份验证。如果没有带有 crumb 的标头,我们会从 webhook 传递中获得以下响应:

<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>Error 403 No valid crumb was included in the request</title>
</head>
<body><h2>HTTP ERROR 403</h2>
<p>Problem accessing /ghprbhook. Reason:
<pre>    No valid crumb was included in the request</pre></p><hr><a href="https://eclipse.org/jetty">Powered by Jetty:// 9.4.z-SNAPSHOT</a><hr/>

</body>
</html>

我们如何告诉 github 我们要使用的标头???

【问题讨论】:

    标签: jenkins github webhooks


    【解决方案1】:

    请参考-https://stackoverflow.com/a/59861256/1726235

    尝试使用 API 密钥而不是密码进行身份验证

    【讨论】:

      【解决方案2】:

      所以 github 目前不支持标头,但事实证明,在我的情况下,这完全是一条红鲱鱼。我只是错过了我的网址上的斜线https://stackoverflow.com/a/51545557/1586965

      【讨论】:

        猜你喜欢
        • 2017-09-05
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-04-27
        相关资源
        最近更新 更多