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

View File

@@ -658,6 +658,7 @@ impl NetworkOptions {
}
if !self.mapped_listeners.is_empty() {
let mut errs = Vec::new();
cfg.set_mapped_listeners(Some(
self.mapped_listeners
.iter()
@@ -668,12 +669,21 @@ impl NetworkOptions {
})
.map(|s: url::Url| {
if s.port().is_none() {
panic!("mapped listener port is missing: {}", s);
errs.push(anyhow::anyhow!("mapped listener port is missing: {}", s));
}
s
})
.collect(),
.collect::<Vec<_>>(),
));
if !errs.is_empty() {
return Err(anyhow::anyhow!(
"{}",
errs.iter()
.map(|x| format!("{}", x))
.collect::<Vec<_>>()
.join("\n")
));
}
}
for n in self.proxy_networks.iter() {