]> git.ardis.lu - alu.bz/commitdiff
Await for full link to resolve
authorArdis Lu <ardisglu@gmail.com>
Sun, 30 Oct 2022 07:25:52 +0000 (00:25 -0700)
committerArdis Lu <ardisglu@gmail.com>
Sun, 30 Oct 2022 07:25:52 +0000 (00:25 -0700)
functions/api.js

index 7e41826f9702fd55b9fab30c6115701a3a479d6b..ea6e05e6e1d3e28dfe3b29d0b2be5542c35cd0b2 100644 (file)
@@ -82,7 +82,7 @@ export async function onRequestPost({ request, env }) {
 export async function onRequestGet({ request, env }) {
   const url = new URL(request.url);
   const shortUrl = url.search.substring(1);
-  const fullUrl = env.links.get(shortUrl);
+  const fullUrl = await env.links.get(shortUrl);
   if (fullUrl === null) {
     return Response.redirect('https://alu.bz');
   }
This page took 0.056194 seconds and 4 git commands to generate.