Skip to content

Commit 61072a5

Browse files
committed
refactor(app/inbound): use ForwardCompatibleBody
see linkerd/linkerd2#8733. Signed-off-by: katelyn martin <[email protected]>
1 parent 806f70c commit 61072a5

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

linkerd/app/inbound/src/http/tests.rs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use linkerd_app_core::{
1111
classify,
1212
errors::header::L5D_PROXY_ERROR,
1313
identity, io, metrics,
14-
proxy::http::{self, Body as _, BoxBody},
14+
proxy::http::{self, BoxBody},
1515
svc::{self, http::TracingExecutor, NewService, Param},
1616
tls,
1717
transport::{ClientAddr, OrigDstAddr, Remote, ServerAddr},
@@ -631,15 +631,21 @@ async fn grpc_response_class() {
631631
.body(hyper::Body::default())
632632
.unwrap();
633633

634-
let mut rsp = client
634+
let rsp = client
635635
.send_request(req)
636636
.await
637637
.expect("HTTP client request failed");
638638
tracing::info!(?rsp);
639639
assert_eq!(rsp.status(), http::StatusCode::OK);
640640

641-
rsp.body_mut().data().await;
642-
let trls = rsp.body_mut().trailers().await.unwrap().unwrap();
641+
let mut body = linkerd_http_body_compat::ForwardCompatibleBody::new(rsp.into_body());
642+
let trls = body
643+
.frame()
644+
.await
645+
.unwrap()
646+
.unwrap()
647+
.into_trailers()
648+
.expect("trailers frame");
643649
assert_eq!(trls.get("grpc-status").unwrap().to_str().unwrap(), "2");
644650

645651
let response_total = metrics

0 commit comments

Comments
 (0)