fix: HIGH+MEDIUM bugs from full audit - listen error, JWT, upload, mailer, webhook
This commit is contained in:
@@ -9,7 +9,12 @@ async function sendWebhook(event, data) {
|
||||
const events = cfg.events || 'all';
|
||||
if (events !== 'all' && !events.split(',').map(s=>s.trim()).includes(event)) continue;
|
||||
const embed = buildEmbed(event, data);
|
||||
try { await fetch(cfg.webhook_url, { method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(embed) }); } catch {}
|
||||
try {
|
||||
const ctrl = new AbortController();
|
||||
const t = setTimeout(() => ctrl.abort(), 10000);
|
||||
await fetch(cfg.webhook_url, { method:'POST', headers:{'Content-Type':'application/json'}, body:JSON.stringify(embed), signal: ctrl.signal });
|
||||
clearTimeout(t);
|
||||
} catch (e) { console.error('[Webhook]', cfg.name, e.message); }
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user