mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-11-27 03:50:12 +03:00
fix: add serverside check against endless loops
This commit is contained in:
parent
66573934f6
commit
9286dcb6ce
1 changed files with 8 additions and 0 deletions
|
@ -674,6 +674,14 @@ let needSetup = false;
|
|||
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
|
||||
server.monitorList[monitor.id]?.prometheus()?.remove();
|
||||
|
||||
|
|
Loading…
Reference in a new issue