nodebb-plugin-webhooks 2.0.0 → 2.0.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.
- package/index.js +2 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
1
|
'use strict';
|
|
3
2
|
|
|
4
3
|
const https = require('https');
|
|
@@ -47,6 +46,7 @@ plugin.onHookFired = async function (hookData) {
|
|
|
47
46
|
hash.update(JSON.stringify(hookData));
|
|
48
47
|
signature = `sha1=${hash.digest('hex')}`;
|
|
49
48
|
}
|
|
49
|
+
// eslint-disable-next-line no-await-in-loop
|
|
50
50
|
await makeRequest(hook.endpoint, hookData, signature);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -85,7 +85,7 @@ async function makeRequest(endpoint, hookData, signature) {
|
|
|
85
85
|
});
|
|
86
86
|
}
|
|
87
87
|
try {
|
|
88
|
-
const { status, data } = await axios.post(endpoint, hookData, )
|
|
88
|
+
const { status, data } = await axios.post(endpoint, hookData, axiosOptions);
|
|
89
89
|
if (status !== 200) {
|
|
90
90
|
winston.error(`[nodebb-plugin-webhooks] ${status} ${data}`);
|
|
91
91
|
}
|
|
@@ -106,7 +106,6 @@ plugin.admin.menu = function (menu, callback) {
|
|
|
106
106
|
setImmediate(callback, null, menu);
|
|
107
107
|
};
|
|
108
108
|
|
|
109
|
-
|
|
110
109
|
socketAdmin.plugins.webhooks = {};
|
|
111
110
|
socketAdmin.plugins.webhooks.save = async function (socket, data) {
|
|
112
111
|
await db.set('nodebb-plugin-webhooks', JSON.stringify(data));
|