diff --git a/Cargo.lock b/Cargo.lock index fd96753..d6e1f82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4706,7 +4706,7 @@ dependencies = [ [[package]] name = "website" -version = "1.2.0" +version = "1.2.1" dependencies = [ "dotenvy", "env_logger", diff --git a/frontend/src/lib/api/probe.ts b/frontend/src/lib/api/probe.ts index e70e573..7ca7afc 100644 --- a/frontend/src/lib/api/probe.ts +++ b/frontend/src/lib/api/probe.ts @@ -32,13 +32,14 @@ export type ProbeResult = { region?: string | null; provider?: string | null; asn?: string | null; - verdict: + verdicts: ( | "uncertain" | "dns_spoofing" | "sni_block" | "tspu_block" | "whitelist" - | "ok"; + | "ok" + )[]; host_results: ProbeHostResult[] | null; target_hop: number | null; dns: { diff --git a/frontend/src/lib/components/result/ProbeTable.svelte b/frontend/src/lib/components/result/ProbeTable.svelte index c32a84e..4560f74 100644 --- a/frontend/src/lib/components/result/ProbeTable.svelte +++ b/frontend/src/lib/components/result/ProbeTable.svelte @@ -110,6 +110,19 @@ const verdictStyles = { border: "border-neutral-400/20", }, }; + +type VerdictStyle = keyof typeof verdictStyles; + +function probeVerdicts( + probe: ProbeResult, + isStaticBlocked: boolean, +): VerdictStyle[] { + return probe.verdicts.map((verdict) => + isStaticBlocked && probe.host_results?.length !== 0 && verdict === "ok" + ? "cdn_block" + : verdict, + ); +}