File tree Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Expand file tree Collapse file tree 1 file changed +14
-8
lines changed Original file line number Diff line number Diff line change @@ -1465,14 +1465,20 @@ impl proto::Peer for Peer {
14651465 // A request translated from HTTP/1 must not include the :authority
14661466 // header
14671467 if let Some ( authority) = pseudo. authority {
1468- let maybe_authority = uri:: Authority :: from_maybe_shared ( authority. clone ( ) . into_inner ( ) ) ;
1469- parts. authority = Some ( maybe_authority. or_else ( |why| {
1470- malformed ! (
1471- "malformed headers: malformed authority ({:?}): {}" ,
1472- authority,
1473- why,
1474- )
1475- } ) ?) ;
1468+ // When connecting to a UNIX Domain Socket (UDS), then we might get a path for the
1469+ // authority field. If it's a local path and exists, then we do not error in that case
1470+ // and assume an UDS.
1471+ if !authority. is_empty ( ) && !authority. ends_with ( ".sock" ) {
1472+ let maybe_authority =
1473+ uri:: Authority :: from_maybe_shared ( authority. clone ( ) . into_inner ( ) ) ;
1474+ parts. authority = Some ( maybe_authority. or_else ( |why| {
1475+ malformed ! (
1476+ "malformed headers: malformed authority ({:?}): {}" ,
1477+ authority,
1478+ why,
1479+ )
1480+ } ) ?) ;
1481+ }
14761482 }
14771483
14781484 // A :scheme is required, except CONNECT.
You can’t perform that action at this time.
0 commit comments