Skip to content

armgit / dub

Public Imported from GitHub
0

The modern link attribution platform. Loved by world-class engineering teams at Twilio, Zillow, Jobber, Vercel, Raycast, and more.

fixed root record clicks

Steven Teye1f388509b96
diff --git a/lib/middleware/root.ts b/lib/middleware/root.ts
index 9380b46855..ee028dafe2 100644
--- a/lib/middleware/root.ts
+++ b/lib/middleware/root.ts
@@ -15,17 +15,11 @@ export default async function RootMiddleware(
return NextResponse.next();
}
- if (!HOME_HOSTNAMES.has(domain) && !domain.endsWith(".vercel.app")) {
- ev.waitUntil(recordClick(domain, req)); // record clicks on root page (if domain is not dub.sh)
- }
-
- if (
- domain === "dub.sh" ||
- domain === "preview.dub.sh" ||
- domain.endsWith(".vercel.app")
- ) {
+ if (HOME_HOSTNAMES.has(domain) || domain.endsWith(".vercel.app")) {
return NextResponse.next();
} else {
+ ev.waitUntil(recordClick(domain, req)); // record clicks on root page (if domain is not dub.sh)
+
const { target, rewrite } =
(await redis.get<RootDomainProps>(`root:${domain}`)) || {};
if (target) {