Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.
TypeScript analyticsaudience-segmentationchartscohort-analysisgoogle-analyticsproduct-analyticsstatisticsuser-journeyweb-analytics
fix: move isbot check after body parsing
Oleh Astappieveafd08b4ee4d
diff --git a/src/app/api/send/route.ts b/src/app/api/send/route.tsindex bd255eaf8..482aad5c7 100644--- a/src/app/api/send/route.ts+++ b/src/app/api/send/route.ts@@ -34,11 +34,6 @@ const schema = z.object({export async function POST(request: Request) {try {- // Bot check- if (!process.env.DISABLE_BOT_CHECK && isbot(request.headers.get('user-agent'))) {- return json({ beep: 'boop' });- }-const { body, error } = await parseRequest(request, schema, { skipAuth: true });if (error) {@@ -86,6 +81,11 @@ export async function POST(request: Request) {const { ip, userAgent, device, browser, os, country, subdivision1, subdivision2, city } =await getClientInfo(request, payload);+ // Bot check+ if (!process.env.DISABLE_BOT_CHECK && isbot(userAgent)) {+ return json({ beep: 'boop' });+ }+// IP blockif (hasBlockedIp(ip)) {return forbidden();