fix: HIGH+MEDIUM bugs from full audit - listen error, JWT, upload, mailer, webhook

This commit is contained in:
2026-07-13 03:49:02 +08:00
parent 7c03fe7635
commit 532efb962f
8 changed files with 56 additions and 29 deletions

View File

@@ -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 {}
}