import { verifyAgent } from './agentAuth';
export async function agentGuard(req: Request) {
  const raw = req.method === 'GET' ? '' : await req.clone().text();
  if (!verifyAgent(req, req.method === 'GET' ? new URL(req.url).pathname + new URL(req.url).search : raw)) return new Response('invalid signature', { status: 401 });
  return null;
}
