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.

.vercel.app

Steven Teya2963c84384b
diff --git a/apps/web/lib/middleware/utils.ts b/apps/web/lib/middleware/utils.ts
index 1b8d066db4..a8c63842a5 100644
--- a/apps/web/lib/middleware/utils.ts
+++ b/apps/web/lib/middleware/utils.ts
@@ -3,8 +3,8 @@ import { NextRequest } from "next/server";
export const parse = (req: NextRequest) => {
let domain = req.headers.get("host") as string;
domain = domain.replace("www.", ""); // remove www. from domain
- if (domain === "dub.localhost:8888" || domain === "staging.dub.sh") {
- // for local development and staging environments
+ if (domain === "dub.localhost:8888" || domain.endsWith(".vercel.app")) {
+ // for local development and preview URLs
domain = "dub.sh";
}