From 6bf4a23d647116e424fb9fabc6c0b10b69dda14f Mon Sep 17 00:00:00 2001 From: multipleof4 Date: Fri, 21 Nov 2025 12:52:26 -0800 Subject: [PATCH] Fix: Clean seized prefix from API response --- functions/api/links/get.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/functions/api/links/get.js b/functions/api/links/get.js index 3db3de4..7afb9c3 100644 --- a/functions/api/links/get.js +++ b/functions/api/links/get.js @@ -4,14 +4,18 @@ export async function onRequestGet({ request, env }) { const slug = url.searchParams.get('slug'); if (!slug) return new Response("Missing slug", { status: 400 }); - const dest = await env.KV_EV.get(slug); + let dest = await env.KV_EV.get(slug); if (!dest) return new Response("Link not found", { status: 404 }); + const seized = dest.startsWith('🚫'); + if (seized) dest = dest.substring(1); + const analytics_enabled = dest.startsWith('✺'); const destination_url = analytics_enabled ? dest.substring(1) : dest; - return Response.json({ destination_url, analytics_enabled }); + return Response.json({ destination_url, analytics_enabled, seized }); } catch (e) { return new Response(e.message, { status: 500 }); } } +