11//! HTTP Version support and negotiation
22use hyper:: Response ;
33use hyper_util:: rt:: TokioIo ;
4+ use bytes:: Bytes ;
45use std:: pin:: Pin ;
56use std:: task:: { Context , Poll } ;
67
@@ -55,15 +56,18 @@ impl HttpVersion {
5556 }
5657}
5758
58- type Http1Sender = hyper:: client:: conn:: http1:: SendRequest < hyper :: body :: Incoming > ;
59- type Http2Sender = hyper:: client:: conn:: http2:: SendRequest < hyper :: body :: Incoming > ;
59+ type Http1Sender = hyper:: client:: conn:: http1:: SendRequest < http_body_util :: Full < Bytes > > ;
60+ type Http2Sender = hyper:: client:: conn:: http2:: SendRequest < http_body_util :: Full < Bytes > > ;
6061
6162type Http1Connection =
62- hyper:: client:: conn:: http1:: Connection < TokioIo < ProxyClientTlsStream > , hyper:: body:: Incoming > ;
63+ hyper:: client:: conn:: http1:: Connection <
64+ TokioIo < ProxyClientTlsStream > ,
65+ http_body_util:: Full < Bytes > ,
66+ > ;
6367
6468type Http2Connection = hyper:: client:: conn:: http2:: Connection <
6569 TokioIo < ProxyClientTlsStream > ,
66- hyper :: body :: Incoming ,
70+ http_body_util :: Full < Bytes > ,
6771 crate :: TokioExecutor ,
6872> ;
6973
@@ -88,8 +92,9 @@ impl From<Http2Sender> for HttpSender {
8892impl HttpSender {
8993 pub async fn send_request (
9094 & mut self ,
91- request : http:: Request < hyper :: body :: Incoming > ,
95+ request : http:: Request < Bytes > ,
9296 ) -> Result < Response < hyper:: body:: Incoming > , hyper:: Error > {
97+ let request = request. map ( http_body_util:: Full :: new) ;
9398 match self {
9499 Self :: Http1 ( sender) => sender. send_request ( request) . await ,
95100 Self :: Http2 ( sender) => sender. send_request ( request) . await ,
0 commit comments