From: Ardis Lu Date: Sun, 30 Oct 2022 07:35:13 +0000 (-0700) Subject: Use client-side redirect X-Git-Url: https://git.ardis.lu/?a=commitdiff_plain;h=d16622389a114c46d2e1a0e79ea0b4090a0cdca4;p=alu.bz Use client-side redirect --- diff --git a/functions/api.js b/functions/api.js index ea6e05e..8ef4a2d 100644 --- a/functions/api.js +++ b/functions/api.js @@ -84,7 +84,7 @@ export async function onRequestGet({ request, env }) { const shortUrl = url.search.substring(1); const fullUrl = await env.links.get(shortUrl); if (fullUrl === null) { - return Response.redirect('https://alu.bz'); + return new Response('https://alu.bz'); } - return Response.redirect(fullUrl); + return new Response(fullUrl); } diff --git a/index.html b/index.html index 6f8750c..3910c32 100644 --- a/index.html +++ b/index.html @@ -67,9 +67,11 @@