Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/openstatus. ๐ซ Status page with uptime monitoring & API monitoring as code ๐ซ openstatus.dev
bun drizzle-orm monitoring monitoring-as-code nextjs observability on-call open-source shadcn-ui status-page statuspage synthetic-monitoring tinybird turso uptime uptime-checker uptime-monitor
Something went wrong. Try again.
653 B ยท 26 lines
TypeScript
123456789101112131415161718192021222324252627import { assertSafeUrlSync } from "@openstatus/utils";
import { ValidationError } from "../errors";
/** * Reject monitor URLs pointing at private/internal infrastructure. * * Only `http` is checked: TCP takes `host:port` and DNS a bare hostname, * neither of which parses as a URL, and TCP documents private targets as a * supported input. */export function assertMonitorUrlSafe(args: { jobType: string; url: string;}): void { if (args.jobType !== "http") return;
try { assertSafeUrlSync(args.url); } catch (err) { throw new ValidationError( err instanceof Error ? err.message : "Invalid URL", err, ); }}