Skip to content

Commit

Permalink
Do not always require an authority
Browse files Browse the repository at this point in the history
This fixes connections where no authority is provide, for example when
using UNIX domain sockets.

Signed-off-by: Sascha Grunert <sgrunert@suse.com>
  • Loading branch information
saschagrunert committed Sep 16, 2020
1 parent a193237 commit 69444f5
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1393,14 +1393,8 @@ impl proto::Peer for Peer {
// A request translated from HTTP/1 must not include the :authority
// header
if let Some(authority) = pseudo.authority {
let maybe_authority = uri::Authority::from_maybe_shared(authority.clone().into_inner());
parts.authority = Some(maybe_authority.or_else(|why| {
malformed!(
"malformed headers: malformed authority ({:?}): {}",
authority,
why,
)
})?);
parts.authority =
uri::Authority::from_maybe_shared(authority.clone().into_inner()).ok();
}

// A :scheme is required, except CONNECT.
Expand Down

0 comments on commit 69444f5

Please sign in to comment.