Merge pull request #3690 from harsh-aghara/feat/accept-status-codes-backend

Add customUpCodes support for HTTP monitors (Backend)
This commit is contained in:
Alexander Holliday authored and GitHub committed 2026-06-08 12:04:42 -07:00
commit ce4cb63035
13 files changed
+346 -60

No files matched your search

+6
View File
@@ -2,6 +2,11 @@ import type { CheckSnapshot } from "@/types/check.js";
export type { CheckSnapshot } from "@/types/check.js";
import type { GeoContinent, GroupedGeoCheck } from "@/types/geoCheck.js";
export type { GeoContinent } from "@/types/geoCheck.js";
import http from "node:http";
export const HttpStatusCodes = Object.keys(http.STATUS_CODES).map(Number);
export const HttpStatusCodeSet = new Set(HttpStatusCodes);
export type HttpStatusCode = number;
export const MonitorTypes = ["http", "ping", "pagespeed", "hardware", "docker", "port", "game", "grpc", "websocket", "dns", "unknown"] as const;
export type MonitorType = (typeof MonitorTypes)[number];
@@ -60,6 +65,7 @@ export interface Monitor {
uptimePercentage?: number;
notifications: string[];
tags: string[];
customUpCodes: HttpStatusCode[];
secret?: string;
cpuAlertThreshold: number;
cpuAlertCounter: number;
+1 -1
View File
@@ -35,7 +35,7 @@ export interface MonitorStatusResponse<
code: number;
message: string;
responseTime?: number;
payload?: T | null;
payload?: T | string | null;
timings?: GotTimings;
first_byte_took?: number;
body_read_took?: number;