mirror of
https://github.com/louislam/uptime-kuma.git
synced 2025-09-16 00:21:52 +08:00
fix: add serverside check against endless loops
This commit is contained in:
@@ -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();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user