File tree 1 file changed +14
-8
lines changed
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 {
1465
1465
// A request translated from HTTP/1 must not include the :authority
1466
1466
// header
1467
1467
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
+ }
1476
1482
}
1477
1483
1478
1484
// A :scheme is required, except CONNECT.
You can’t perform that action at this time.
0 commit comments