The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Update route.ts
Kiran K7e3293a4736c
diff --git a/apps/web/app/(ee)/api/stripe/integration/webhook/route.ts b/apps/web/app/(ee)/api/stripe/integration/webhook/route.tsindex 5f48243f36..e0d2032732 100644--- a/apps/web/app/(ee)/api/stripe/integration/webhook/route.ts+++ b/apps/web/app/(ee)/api/stripe/integration/webhook/route.ts@@ -19,12 +19,12 @@ const relevantEvents = new Set([// POST /api/stripe/integration/webhook – listen to Stripe webhooks (for Stripe Integration)export const POST = withAxiom(async (req: Request) => {- // Skip the request with query params version=latest- // We'll remove this once we're ready to go live- if (req.url.includes("version=latest")) {- return new Response(- "Ignore the request from the new webhook with ?version=latest",- );+ const url = new URL(req.url);+ const version = url.searchParams.get("version");++ // Skip the older webhook without query params+ if (!version) {+ return new Response("Ignore the events from the older webhook.");}const buf = await req.text();