Increase ping validation limit to 100 billion ms (~3.17 years)

Co-authored-by: CommanderStorm <26258709+CommanderStorm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2026-01-11 07:09:51 +00:00
parent 10363388c0
commit 0ac5286c76

View File

@ -52,9 +52,9 @@ router.all("/api/push/:pushToken", async (request, response) => {
let statusString = request.query.status || "up";
const statusFromParam = statusString === "up" ? UP : DOWN;
// Validate ping value - max 1 billion ms (~11.5 days)
// Validate ping value - max 100 billion ms (~3.17 years)
// Fits safely in both BIGINT and FLOAT(20,2)
const MAX_PING_MS = 1000000000;
const MAX_PING_MS = 100000000000;
if (ping !== null && (ping < 0 || ping > MAX_PING_MS)) {
throw new Error(`Invalid ping value. Must be between 0 and ${MAX_PING_MS} ms.`);
}