From 7f09c36a92ee45d362a4815f5e51cc4918c24c71 Mon Sep 17 00:00:00 2001 From: Louis Date: Tue, 23 Sep 2025 17:45:37 +0700 Subject: [PATCH] fix: LocalAPI server trusted host should accept asterisk (#6551) --- src-tauri/utils/src/http.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src-tauri/utils/src/http.rs b/src-tauri/utils/src/http.rs index 3fd4007ec..bdae2d262 100644 --- a/src-tauri/utils/src/http.rs +++ b/src-tauri/utils/src/http.rs @@ -6,6 +6,10 @@ pub fn is_cors_header(header_name: &str) -> bool { /// Validates if host is in trusted hosts list pub fn is_valid_host(host: &str, trusted_hosts: &[Vec]) -> bool { + if trusted_hosts.iter().any(|hosts| hosts.contains(&"*".to_string())) { + return true; + } + if host.is_empty() { return false; }