This commit is contained in:
Maurus Decimus
2026-07-12 19:18:29 +02:00
parent 602025464b
commit 764c2c1e1c
8 changed files with 27 additions and 24 deletions

View File

@@ -632,8 +632,8 @@ fn is_known_resource<'x>(hostnames: impl IntoIterator<Item = &'x str>, uri: &str
let authority = rest.split_once('/').map_or(rest, |(auth, _)| auth);
let host = authority
.rsplit_once(':')
.filter(|(h, _)| h.as_bytes().iter().all(|c| c.is_ascii_digit()))
.map_or(authority, |(h, _)| h);
.filter(|(_, port)| !port.is_empty() && port.as_bytes().iter().all(|c| c.is_ascii_digit()))
.map_or(authority, |(host, _)| host);
supported
&& hostnames