fix: LocalAPI server trusted host should accept asterisk (#6551)

This commit is contained in:
Louis 2025-09-23 17:45:37 +07:00 committed by GitHub
parent 6f827872fb
commit 7f09c36a92
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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<String>]) -> bool {
if trusted_hosts.iter().any(|hosts| hosts.contains(&"*".to_string())) {
return true;
}
if host.is_empty() {
return false;
}