Openstatus www.openstatus.dev
at e04c855d4ded3de361d0d758827dbfc50ff511d0 10 lines 332 B view raw
1export const isAnInvalidTestUrl = (rawUrl: string) => { 2 const url = new URL(rawUrl); 3 const isSelfHostName = url.hostname 4 .split(".") 5 .slice(-2) // ex: any.sub.openstatus.dev 6 .join(".") 7 .includes("openstatus.dev"); // ex: openstatus.dev:80 8 9 return isSelfHostName && url.pathname.startsWith("/api/checker/"); 10};