From e0e991b59943c2e58d109ff3ca2e6804d0eb9096 Mon Sep 17 00:00:00 2001 From: Huang Xin Date: Tue, 18 Nov 2025 18:14:30 +0530 Subject: [PATCH] fix(kosync): proxy kosync request only for the web app, closes #2440 (#2466) --- apps/readest-app/src-tauri/capabilities/default.json | 6 ++++++ apps/readest-app/src/services/sync/KOSyncClient.ts | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/readest-app/src-tauri/capabilities/default.json b/apps/readest-app/src-tauri/capabilities/default.json index f9b6ba8a..79bebce0 100644 --- a/apps/readest-app/src-tauri/capabilities/default.json +++ b/apps/readest-app/src-tauri/capabilities/default.json @@ -104,6 +104,12 @@ }, { "url": "https://*:*" + }, + { + "url": "http://*" + }, + { + "url": "https://*" } ] }, diff --git a/apps/readest-app/src/services/sync/KOSyncClient.ts b/apps/readest-app/src/services/sync/KOSyncClient.ts index 94fab562..d4192f14 100644 --- a/apps/readest-app/src/services/sync/KOSyncClient.ts +++ b/apps/readest-app/src/services/sync/KOSyncClient.ts @@ -45,7 +45,7 @@ export class KOSyncClient { headers.set('X-Auth-Key', this.config.userkey); } - if (this.isLanServer) { + if (this.isLanServer || isTauriAppPlatform()) { const fetch = isTauriAppPlatform() ? tauriFetch : window.fetch; const directUrl = `${this.config.serverUrl}${endpoint}`;