fix: LocalAPI server trusted host should accept asterisk (#6551)
This commit is contained in:
parent
6f827872fb
commit
7f09c36a92
@ -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;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user