@kne/fastify-webhook 0.1.3-alpha.0 → 0.1.3-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -104,11 +104,14 @@ module.exports = fp(async (fastify, options) => {
104
104
  .createHash('md5')
105
105
  .update(`${webhook.name}|${webhook.expire ? webhook.expire.getTime() : 0}`)
106
106
  .digest('hex');
107
- if (webhook.shouldEncryptVerify && generateSignature(md5, rawBody) === signature) {
107
+
108
+ const shouldEncryptVerify = webhook.inputLocation === 'body' && webhook.shouldEncryptVerify;
109
+
110
+ if (shouldEncryptVerify && generateSignature(md5, rawBody) === signature) {
108
111
  currentWebhook = webhook;
109
112
  break;
110
113
  }
111
- if (!webhook.shouldEncryptVerify) {
114
+ if (!shouldEncryptVerify) {
112
115
  if (md5 === signature) {
113
116
  currentWebhook = webhook;
114
117
  break;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kne/fastify-webhook",
3
- "version": "0.1.3-alpha.0",
3
+ "version": "0.1.3-alpha.1",
4
4
  "description": "实现一个webhook功能.",
5
5
  "main": "index.js",
6
6
  "scripts": {