fix(webhooks): correct Ombi isReplay() call after signature change (closes #70)
This commit is contained in:
@@ -813,10 +813,10 @@ router.post('/ombi', webhookLimiter, (req, res) => {
|
||||
|
||||
// Use applicationUrl as instance identifier for replay protection
|
||||
const instanceName = applicationUrl || 'ombi';
|
||||
// Use requestId + eventType + current time as replay key
|
||||
const eventDate = req.body.requestedDate || req.body.RequestedDate || new Date().toISOString();
|
||||
const contentId = requestId || null;
|
||||
|
||||
if (isReplay(eventType, instanceName, `${requestId}-${eventDate}`)) {
|
||||
if (isReplay(eventType, instanceName, eventDate, contentId)) {
|
||||
logToFile(`[Webhook] Ombi duplicate event ignored: ${eventType} requestId=${requestId}`);
|
||||
return res.status(200).json({ received: true, duplicate: true });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user