The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
Implement case-sensitive key encoding for deep link queries (#3367)
Kiran K0f12684f5136
diff --git a/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx b/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsxindex bcea219f88..71926a3e66 100644--- a/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx+++ b/apps/web/app/app.dub.co/(deeplink)/deeplink/[domain]/[key]/page.tsx@@ -9,6 +9,7 @@ import { redirect } from "next/navigation";import { DeepLinkActionButtons } from "./action-buttons";import { BrandLogoBadge } from "./brand-logo-badge";import { getLanguage, getTranslations } from "./translations";+import { encodeKeyIfCaseSensitive } from "@/lib/api/links/case-sensitivity";export default async function DeepLinkPreviewPage(props: {params: Promise<{ domain: string; key: string }>;@@ -23,11 +24,17 @@ export default async function DeepLinkPreviewPage(props: {const language = getLanguage(acceptLanguage);const t = getTranslations(language);+ // Encode the key for case-sensitive domains before querying+ const encodedKey = encodeKeyIfCaseSensitive({+ domain,+ key+ });+const link = await prisma.link.findUnique({where: {domain_key: {domain,- key,+ key: encodedKey,},},select: {