From 07c7fc4836197b15cfc72f97d8ddd2e47a149fc5 Mon Sep 17 00:00:00 2001 From: yggverse Date: Tue, 29 Jul 2025 12:10:53 +0300 Subject: [PATCH] update host validation rule --- src/app/browser/proxy/ignore/row.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/app/browser/proxy/ignore/row.rs b/src/app/browser/proxy/ignore/row.rs index daf29797..be5697a6 100644 --- a/src/app/browser/proxy/ignore/row.rs +++ b/src/app/browser/proxy/ignore/row.rs @@ -163,15 +163,12 @@ fn validate(host: &Entry) -> bool { } fn validate_host(value: &str) -> Result<(), String> { - match gtk::gio::NetworkAddress::parse(value, 0) { - Ok(address) => { - use gtk::prelude::NetworkAddressExt; - if address.hostname() != value { - Err("Hostname or IP address could not be parsed properly".to_string()) - } else { - Ok(()) - } - } + // https://docs.gtk.org/gio/property.SimpleProxyResolver.ignore-hosts.html + match gtk::gio::NetworkAddress::parse( + value.trim_start_matches('.').trim_start_matches('*'), + 0, + ) { + Ok(_) => Ok(()), Err(e) => Err(format!("Valid hostname or IP address is required: `{e}`")), } }