fix(monitors): rate limit heartbeats per token and kind; test limiter key and fail body cap

This commit is contained in:
2026-09-17 09:22:50 +00:00
parent 2afdc267f8
commit 13e7160405
3 changed files with 72 additions and 13 deletions
-1
View File
@@ -26,7 +26,6 @@ test("heartbeat monitor: URL ping, /fail, header ping", async ({ page, request }
let got = await (await page.request.get(`${BASE_URL}/api/monitors/${monitor.monitor_id}`)).json();
expect(got.state.status).toBe("up");
await new Promise((r) => setTimeout(r, 1100)); // per-token limit is 1/s
const fail = await request.post(`${BASE_URL}/public/hb/${monitor.heartbeat_token}/fail`, { data: "disk full" });
expect(fail.status()).toBe(200);