import type { NextRequest } from "next/server"; // State-changing routes only accept same-origin requests carrying JSON. Browsers send Sec-Fetch-Site on every // request and Origin on cross-origin POSTs, so a cross-site