使用来自GitHub和Smee的Probot API测试无法接受有效负载?

时间:2018-05-07 03:30:46

标签: javascript github probot

我将一些示例数据发布到我的Smee端点,我也在运行我的ProBot应用的本地实例。我的机器人日志中收到了一个错误的请求,我发现这是Smee的回复:

  { Error: cannot POST / (400)
at Response.toError (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/response.js:94:15)
at ResponseBase._setStatusProperties (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/response-base.js:123:16)
at new Response (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/response.js:41:8)
at Request._emitResponse (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:752:20)
at IncomingMessage.parser (/usr/local/lib/node_modules/smee-client/node_modules/superagent/lib/node/index.js:916:38)
at emitNone (events.js:111:20)
at IncomingMessage.emit (events.js:208:7)
at endReadableNT (_stream_readable.js:1055:12)
at _combinedTickCallback (internal/process/next_tick.js:138:11)
at process._tickCallback (internal/process/next_tick.js:180:9)
    status: 400,
    text: 'Required headers missing: x-github-event, x-github-delivery',
    method: 'POST',
    path: '/' },

如何在我的应用中测试这些标头值?不确定它是不是我,但文档在任何地方都没有注意到

1 个答案:

答案 0 :(得分:0)

我使用https://www.freeformatter.com/hmac-generator.html#ad-output投入有效负载作为正文,我的秘密和哈希是有效的!