From 464f8095ab69249a9257826126a21ea9b0916fc7 Mon Sep 17 00:00:00 2001 From: Tunglies Date: Thu, 22 May 2025 19:18:48 +0800 Subject: [PATCH] fix: update CORS allow-origins to support tauri local development - Replaced 'http://localhost' and 'http://127.0.0.1' with 'tauri://localhost' and 'http://tauri.localhost' for enhanced compatibility with Tauri development environment. - Ensures proper CORS configuration for local testing. --- src-tauri/src/config/clash.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src-tauri/src/config/clash.rs b/src-tauri/src/config/clash.rs index faf9f7e2f..c16ec2d37 100644 --- a/src-tauri/src/config/clash.rs +++ b/src-tauri/src/config/clash.rs @@ -55,8 +55,8 @@ impl IClashTemp { cors_map.insert( "allow-origins".into(), vec![ - "http://localhost", - "http://127.0.0.1", + "tauri://localhost", + "http://tauri.localhost", "http://localhost:3000", ] .into(), @@ -92,8 +92,8 @@ impl IClashTemp { cors_map.insert( "allow-origins".into(), vec![ - "http://localhost", - "http://127.0.0.1", + "tauri://localhost", + "http://tauri.localhost", "http://localhost:3000", ] .into(),