File tree Expand file tree Collapse file tree 1 file changed +12
-12
lines changed
linkerd/app/outbound/src/http/logical Expand file tree Collapse file tree 1 file changed +12
-12
lines changed Original file line number Diff line number Diff line change @@ -157,25 +157,25 @@ async fn serve(
157157 handle : & mut tower_test:: mock:: Handle < Request , Response > ,
158158 call : impl Future < Output = Result < Response > > + Send + ' static ,
159159) {
160- let ( mut req, tx) = handle
160+ let ( req, tx) = handle
161161 . next_request ( )
162162 . await
163163 . expect ( "service must receive request" ) ;
164164 tracing:: debug!( ?req, "Received request" ) ;
165165
166166 // Ensure the whole request is processed.
167- if !req . body ( ) . is_end_stream ( ) {
168- while let Some ( res ) = req . body_mut ( ) . data ( ) . await {
169- res . expect ( "request body must not error" ) ;
170- }
171- if !req . body ( ) . is_end_stream ( ) {
172- req . body_mut ( )
173- . trailers ( )
174- . await
175- . expect ( "request body must not error" ) ;
176- }
167+ let ( parts , mut body ) = req
168+ . map ( linkerd_http_body_compat :: ForwardCompatibleBody :: new )
169+ . into_parts ( ) ;
170+ if !body . is_end_stream ( ) {
171+ while let Some ( _ ) = body
172+ . frame ( )
173+ . await
174+ . transpose ( )
175+ . expect ( "request body must not error" )
176+ { }
177177 }
178- drop ( req ) ;
178+ drop ( ( parts , body ) ) ;
179179
180180 tokio:: spawn (
181181 async move {
You can’t perform that action at this time.
0 commit comments