mirror of
https://github.com/ajayyy/SponsorBlockServer.git
synced 2026-04-09 12:38:56 +03:00
Merge pull request #4 from Joe-Dowd/testing-custom-webhooks
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;
|
||||||
|
} else if (config.mode === 'test') {
|
||||||
|
settings.WARN = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function log(level, string) {
|
function log(level, string) {
|
||||||
|
|||||||
@@ -38,7 +38,10 @@ function dispatchEvent(scope, data) {
|
|||||||
request.post(webhookURL, {json: data, headers: {
|
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);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,6 +31,13 @@
|
|||||||
"vote.up",
|
"vote.up",
|
||||||
"vote.down"
|
"vote.down"
|
||||||
]
|
]
|
||||||
|
}, {
|
||||||
|
"url": "http://127.0.0.1:8099/WrongPort",
|
||||||
|
"key": "superSecretKey",
|
||||||
|
"scopes": [
|
||||||
|
"vote.up",
|
||||||
|
"vote.down"
|
||||||
|
]
|
||||||
}, {
|
}, {
|
||||||
"url": "http://unresolvable.host:8081/FailedWebhook",
|
"url": "http://unresolvable.host:8081/FailedWebhook",
|
||||||
"key": "superSecretKey",
|
"key": "superSecretKey",
|
||||||
|
|||||||
Reference in New Issue
Block a user