mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2025-12-08 20:47:02 +03:00
Fixed undesolved test error
This commit is contained in:
@@ -45,6 +45,8 @@ const settings = {
|
|||||||
if (config.mode === 'development') {
|
if (config.mode === 'development') {
|
||||||
settings.INFO = true;
|
settings.INFO = true;
|
||||||
settings.DEBUG = true;
|
settings.DEBUG = true;
|
||||||
|
} if (config.mode === 'test') {
|
||||||
|
settings.WARN = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function log(level, string) {
|
function log(level, string) {
|
||||||
|
|||||||
@@ -35,10 +35,13 @@ function dispatchEvent(scope, data) {
|
|||||||
let authKey = webhook.key;
|
let authKey = webhook.key;
|
||||||
let scopes = webhook.scopes || [];
|
let scopes = webhook.scopes || [];
|
||||||
if (!scopes.includes(scope.toLowerCase())) return;
|
if (!scopes.includes(scope.toLowerCase())) return;
|
||||||
request.post(webhookURL, {json: data, headers: {
|
let hookRequest = request.post(webhookURL, {json: data, headers: {
|
||||||
"Authorization": authKey,
|
"Authorization": authKey,
|
||||||
"Event-Type": scope // Maybe change this in the future?
|
"Event-Type": scope // Maybe change this in the future?
|
||||||
}});
|
}}).on('error', (e) => {
|
||||||
|
logger.warn('Couldn\'t send webhook to ' + webhook.url);
|
||||||
|
logger.warn(e);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user