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.

fix cors

Steven Teye39b2f2836c0
diff --git a/pages/api/edge/links/[key]/stats/[endpoint].ts b/pages/api/edge/links/[key]/stats/[endpoint].ts
index 98bbf4dad8..25df4e5094 100644
--- a/pages/api/edge/links/[key]/stats/[endpoint].ts
+++ b/pages/api/edge/links/[key]/stats/[endpoint].ts
@@ -62,21 +62,7 @@ export default async function handler(req: NextRequest) {
interval,
});
- return new Response(JSON.stringify(response), {
- status: 200,
- headers: {
- "Access-Control-Allow-Origin": "*",
- "Access-Control-Allow-Methods": "GET, OPTIONS",
- },
- });
- } else if (req.method === "OPTIONS") {
- return new Response(null, {
- status: 204,
- headers: {
- "Access-Control-Allow-Origin": "*",
- "Access-Control-Allow-Methods": "GET, OPTIONS",
- },
- });
+ return new Response(JSON.stringify(response), { status: 200 });
} else {
return new Response(`Method ${req.method} Not Allowed`, { status: 405 });
}