From 41f31f617cacc3b968f688047879892877318e47 Mon Sep 17 00:00:00 2001 From: kwaroran Date: Fri, 4 Aug 2023 14:47:22 +0900 Subject: [PATCH] [fix] webfix --- src/ts/storage/globalApi.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ts/storage/globalApi.ts b/src/ts/storage/globalApi.ts index 8ed6e5dd..d7ade718 100644 --- a/src/ts/storage/globalApi.ts +++ b/src/ts/storage/globalApi.ts @@ -515,10 +515,12 @@ export async function globalFetch(url:string, arg:{ console.log(urlHost) //check if the url is a local url like localhost if(urlHost.includes("localhost") || urlHost.includes("172.0.0.1") || urlHost.includes("0.0.0.0")){ - return { - ok: false, - data: 'You are trying local request on web version. this is not allowed dude to browser security policy. use the desktop version instead, or use tunneling service like ngrok and set the cors to allow all.', - headers: {} + if((!isTauri) && (!isNodeServer)){ + return { + ok: false, + data: 'You are trying local request on web version. this is not allowed dude to browser security policy. use the desktop version instead, or use tunneling service like ngrok and set the cors to allow all.', + headers: {} + } } }