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.

punyencode path

Steven Teyb3a383f2a2ed
diff --git a/apps/web/lib/middleware/utils/create-response-with-cookie.ts b/apps/web/lib/middleware/utils/create-response-with-cookie.ts
index 4de36ed7e9..eccd3e6d5b 100644
--- a/apps/web/lib/middleware/utils/create-response-with-cookie.ts
+++ b/apps/web/lib/middleware/utils/create-response-with-cookie.ts
@@ -1,3 +1,4 @@
+import { punyEncode } from "@dub/utils";
import { NextResponse } from "next/server";
export function createResponseWithCookie(
@@ -5,7 +6,7 @@ export function createResponseWithCookie(
{ clickId, path }: { clickId: string; path: string },
): NextResponse {
response.cookies.set("dclid", clickId, {
- path,
+ path: punyEncode(path), // encode the key to handle non-ASCII characters
maxAge: 60 * 60, // 1 hour
});