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 incorrect proxy hostname

Steven Teyf39d80f9e259
diff --git a/lib/middleware/link.ts b/lib/middleware/link.ts
index 58a88b0a24..0cd6500d43 100644
--- a/lib/middleware/link.ts
+++ b/lib/middleware/link.ts
@@ -44,8 +44,9 @@ export default async function LinkMiddleware(
ev.waitUntil(recordClick(hostname, req, key)); // increment click count
if (image && description && isBot) {
- url.pathname = `/proxy/${hostname}/${key}`;
- res = NextResponse.rewrite(url);
+ res = NextResponse.rewrite(
+ `https://preview.dub.sh/proxy/${hostname}/${key}`
+ );
} else {
res = NextResponse.redirect(target);
}