1
2
3
4
5
6
7
8
9
10
11
import { fetch } from "https://esm.town/v/std/fetch";
export default async function(req: Request): Promise<Response> {
const p = Object.fromEntries(new URL(req.url).searchParams);
if (!p.url) return Response.json("missing url");
console.log("checking", p.url);
const res = await fetch(p.url);
if (!res.ok) return Response.json(res.status);
const txt = await res.text();
console.log("got", res.status, txt);
return Response.json(txt.includes("HFS"));
}