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.

Make sure the new link shortcut takes the full URL

Steven Tey1effd6a78fc5
diff --git a/apps/web/lib/middleware/create-link.ts b/apps/web/lib/middleware/create-link.ts
index a00c4f1aa3..c05cd8f5ea 100644
--- a/apps/web/lib/middleware/create-link.ts
+++ b/apps/web/lib/middleware/create-link.ts
@@ -3,9 +3,9 @@ import { APP_DOMAIN, getUrlFromString } from "@dub/utils";
import { NextRequest, NextResponse } from "next/server";
export default function CreateLinkMiddleware(req: NextRequest) {
- const { domain, fullKey } = parse(req);
+ const { domain, fullPath } = parse(req);
- const url = getUrlFromString(fullKey);
+ const url = getUrlFromString(fullPath.slice(1));
const redirectURL = new URL(`${APP_DOMAIN}/new`);
redirectURL.searchParams.append("link", url);