出于某种原因,我不能做这项工作保护尤伯杯网络挂接不工作
require crypto = require('crypto')
const hmac = crypto.createHmac('sha256', 'clientSecret')
const hash = hmac.update(JSON.stringify(req.body)).digest('hex')
if (hash !== req.header('X-Uber-Signature')) {
return res.json('something is wrong ' + hash + ' ' + req.header('X-Uber-Signature'))
}
return res.json('you got in!')
我在这里的下一条指令https://developer.uber.com/docs/riders/guides/webhooks#security
但哈希生成不同的值
的其他方法同样欢迎。
什么是您所期望的价值是什么?你得到什么? –