File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -64,8 +64,6 @@ impl outgoing_handler::Host for WasiHttpCtxView<'_> {
6464
6565 let authority = req. authority . unwrap_or_else ( String :: new) ;
6666
67- builder = builder. header ( hyper:: header:: HOST , & authority) ;
68-
6967 let mut uri = http:: Uri :: builder ( )
7068 . scheme ( scheme)
7169 . authority ( authority. clone ( ) ) ;
Original file line number Diff line number Diff line change @@ -582,6 +582,14 @@ pub async fn default_send_request_handler(
582582 use tokio:: net:: TcpStream ;
583583 use tokio:: time:: timeout;
584584
585+ if !request. headers ( ) . contains_key ( hyper:: header:: HOST ) {
586+ if let Some ( authority) = request. uri ( ) . authority ( ) {
587+ if let Ok ( value) = hyper:: header:: HeaderValue :: from_str ( authority. as_str ( ) ) {
588+ request. headers_mut ( ) . insert ( hyper:: header:: HOST , value) ;
589+ }
590+ }
591+ }
592+
585593 let authority = if let Some ( authority) = request. uri ( ) . authority ( ) {
586594 if authority. port ( ) . is_some ( ) {
587595 authority. to_string ( )
You can’t perform that action at this time.
0 commit comments