The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.
TypeScript clickhousemysqlnextjsopen-sourceplanetscaleprismatailwindcsstinybirdtypescriptupstashvercel
remove www. from parsed domain
Steven Teyfc5c13271652
diff --git a/lib/middleware/utils.ts b/lib/middleware/utils.tsindex 20780e1580..3748b4f35e 100644--- a/lib/middleware/utils.ts+++ b/lib/middleware/utils.ts@@ -3,6 +3,7 @@ import { HOME_HOSTNAMES } from "@/lib/constants";export const parse = (req: NextRequest) => {let domain = req.headers.get("host");+ domain = domain.replace("www.", ""); // remove www. from domainif (HOME_HOSTNAMES.has(domain)) domain = "dub.sh";const path = req.nextUrl.pathname;const key = decodeURIComponent(path.split("/")[1]); // to handle foreign languages like Hebrew