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.

add demo link

Steven Teya84e8bdbcf9a
diff --git a/apps/web/lib/middleware/link.ts b/apps/web/lib/middleware/link.ts
index c39b7be8d7..52e5882d61 100644
--- a/apps/web/lib/middleware/link.ts
+++ b/apps/web/lib/middleware/link.ts
@@ -8,7 +8,6 @@ import {
import { recordClick } from "@/lib/tinybird";
import { formatRedisLink, redis } from "@/lib/upstash";
import {
- DUB_DEMO_LINKS,
DUB_HEADERS,
LEGAL_WORKSPACE_ID,
LOCALHOST_GEO_DATA,
@@ -23,7 +22,6 @@ import {
NextResponse,
userAgent,
} from "next/server";
-import { isBlacklistedReferrer } from "../edge-config";
import { getLinkViaEdge } from "../planetscale";
import { RedisLinkProps } from "../types";
@@ -41,19 +39,6 @@ export default async function LinkMiddleware(
// links on Dub are case insensitive by default
let key = punyEncode(originalKey.toLowerCase());
- const demoLink = DUB_DEMO_LINKS.find(
- (l) => l.domain === domain && l.key === key,
- );
-
- // if it's a demo link, block bad referrers in production
- if (
- process.env.NODE_ENV !== "development" &&
- demoLink &&
- (await isBlacklistedReferrer(req.headers.get("referer")))
- ) {
- return new Response("Don't DDoS me pls 🥺", { status: 429 });
- }
-
const inspectMode = key.endsWith("+");
// if inspect mode is enabled, remove the trailing `+` from the key
if (inspectMode) {
diff --git a/packages/utils/src/constants/dub-domains.ts b/packages/utils/src/constants/dub-domains.ts
index dd604f2a96..66f61ee1ba 100644
--- a/packages/utils/src/constants/dub-domains.ts
+++ b/packages/utils/src/constants/dub-domains.ts
@@ -166,4 +166,9 @@ export const DUB_DEMO_LINKS = [
domain: "amzn.id",
key: "tv",
},
+ {
+ id: "clymd73o50001ulmzzxjumr8l",
+ domain: "ggl.link",
+ key: "dub",
+ },
];