@hostwebhook/node 1.0.3 → 1.0.4
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/dist/index.js +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -231,8 +231,9 @@ var HostWebhook = class {
|
|
|
231
231
|
...options?.headers
|
|
232
232
|
};
|
|
233
233
|
if (this.signingSecret) {
|
|
234
|
-
const
|
|
235
|
-
|
|
234
|
+
const timestamp = Math.floor(Date.now() / 1e3);
|
|
235
|
+
const sig = (0, import_crypto2.createHmac)("sha256", this.signingSecret).update(`${timestamp}.${body}`).digest("hex");
|
|
236
|
+
headers["X-HostWebhook-Signature"] = `t=${timestamp},v1=${sig}`;
|
|
236
237
|
}
|
|
237
238
|
const url = `${this.baseUrl}/api/in/${this.token}`;
|
|
238
239
|
const controller = new AbortController();
|
package/dist/index.mjs
CHANGED
|
@@ -197,8 +197,9 @@ var HostWebhook = class {
|
|
|
197
197
|
...options?.headers
|
|
198
198
|
};
|
|
199
199
|
if (this.signingSecret) {
|
|
200
|
-
const
|
|
201
|
-
|
|
200
|
+
const timestamp = Math.floor(Date.now() / 1e3);
|
|
201
|
+
const sig = createHmac2("sha256", this.signingSecret).update(`${timestamp}.${body}`).digest("hex");
|
|
202
|
+
headers["X-HostWebhook-Signature"] = `t=${timestamp},v1=${sig}`;
|
|
202
203
|
}
|
|
203
204
|
const url = `${this.baseUrl}/api/in/${this.token}`;
|
|
204
205
|
const controller = new AbortController();
|