mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-12-18 04:04:41 -05:00
fix: add serverside check against endless loops
This commit is contained in:
parent
66573934f6
commit
9286dcb6ce
@ -674,6 +674,14 @@ let needSetup = false;
|
|||||||
throw new Error("Permission denied.");
|
throw new Error("Permission denied.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if Parent is Decendant (would cause endless loop)
|
||||||
|
if (monitor.parent !== null) {
|
||||||
|
const childIDs = await Monitor.getAllChildrenIDs(monitor.id);
|
||||||
|
if (childIDs.includes(monitor.parent)) {
|
||||||
|
throw new Error("Invalid Monitor Group");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Reset Prometheus labels
|
// Reset Prometheus labels
|
||||||
server.monitorList[monitor.id]?.prometheus()?.remove();
|
server.monitorList[monitor.id]?.prometheus()?.remove();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user