Skip to content

Commit e0f4147

Browse files
committed
refactor(app/outbound): use ForwardCompatibleBody
Signed-off-by: katelyn martin <[email protected]>
1 parent 7d34226 commit e0f4147

File tree

1 file changed

+12
-12
lines changed
  • linkerd/app/outbound/src/http/logical

1 file changed

+12
-12
lines changed

linkerd/app/outbound/src/http/logical/tests.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff 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 {

0 commit comments

Comments
 (0)