mirror of
https://github.com/louislam/uptime-kuma.git
synced 2024-10-30 03:00:40 +00: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.");
|
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 a new issue