Skip to content

Commit c4b2913

Browse files
committed
Do not always require an authority
This fixes connections where no authority is provide, for example when using UNIX domain sockets. Signed-off-by: Sascha Grunert <[email protected]>
1 parent a193237 commit c4b2913

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

src/server.rs

+4-8
Original file line numberDiff line numberDiff line change
@@ -1393,14 +1393,10 @@ impl proto::Peer for Peer {
13931393
// A request translated from HTTP/1 must not include the :authority
13941394
// header
13951395
if let Some(authority) = pseudo.authority {
1396-
let maybe_authority = uri::Authority::from_maybe_shared(authority.clone().into_inner());
1397-
parts.authority = Some(maybe_authority.or_else(|why| {
1398-
malformed!(
1399-
"malformed headers: malformed authority ({:?}): {}",
1400-
authority,
1401-
why,
1402-
)
1403-
})?);
1396+
parts.authority = uri::Authority::from_maybe_shared(
1397+
authority.clone().into_inner(),
1398+
)
1399+
.ok();
14041400
}
14051401

14061402
// A :scheme is required, except CONNECT.

0 commit comments

Comments
 (0)