fix incorrect config check (#1086)

This commit is contained in:
Sijie.Sun
2025-07-06 14:20:49 +08:00
committed by GitHub
parent 3c65594030
commit 13c2e72871
6 changed files with 62 additions and 21 deletions
+6
View File
@@ -147,6 +147,12 @@ pub async fn create_connector_by_url(
Box::new(connector)
}
"txt" | "srv" => {
if url.host_str().is_none() {
return Err(Error::InvalidUrl(format!(
"host should not be empty in txt or srv url: {}",
url
)));
}
let connector = dns_connector::DNSTunnelConnector::new(url, global_ctx.clone());
Box::new(connector)
}