From 5cfcecd9f9c3a136c11191da1a03071e6df0a85f Mon Sep 17 00:00:00 2001 From: alyssadev Date: Mon, 18 Sep 2023 05:45:58 +1000 Subject: [PATCH] am i out of touch? no, it's sharex who's wrong --- src/index.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 787661f..7953917 100644 --- a/src/index.js +++ b/src/index.js @@ -57,12 +57,10 @@ async function add(request,host,path) { return new Response(`https://${host}/${path}`, {status:201}) } catch (e) { if (e instanceof TypeError) { + if (!dest) return new Response("No file provided", {status:400}) await FILES.put(path, dest) - var type = dest.type - if (type === "undefined") type = "text/plain" // dammit sharex await KV.put(path,dest.type) return new Response(`https://${host}/${path}`, {status:201}) -// return new Response("No valid URL provided",{status:400}); } else throw e; };