Fixed undesolved test error

This commit is contained in:
Joe Dowd
2020-08-24 22:40:02 +01:00
parent eb9282c60a
commit 3563924c6f
2 changed files with 7 additions and 2 deletions

View File

@@ -35,10 +35,13 @@ function dispatchEvent(scope, data) {
let authKey = webhook.key;
let scopes = webhook.scopes || [];
if (!scopes.includes(scope.toLowerCase())) return;
request.post(webhookURL, {json: data, headers: {
let hookRequest = request.post(webhookURL, {json: data, headers: {
"Authorization": authKey,
"Event-Type": scope // Maybe change this in the future?
}});
}}).on('error', (e) => {
logger.warn('Couldn\'t send webhook to ' + webhook.url);
logger.warn(e);
});
});
}