Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.

Commit 82cce2a

Browse files
committed
fix: check if port correctly specified
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent 69386e8 commit 82cce2a

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

crates/wasi-http/src/p3/host/types.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,9 +771,13 @@ where
771771
req.authority = None;
772772
return Ok(Ok(()));
773773
};
774-
let Ok(authority) = authority.try_into() else {
774+
let has_port = authority.contains(':');
775+
let Ok(authority) = http::uri::Authority::try_from(authority) else {
775776
return Ok(Err(()));
776777
};
778+
if has_port && authority.port_u16().is_none() {
779+
return Ok(Err(()));
780+
}
777781
req.authority = Some(authority);
778782
Ok(Ok(()))
779783
}

0 commit comments

Comments
 (0)