From f5edf6f4c9ee74dc4d9068d3c74264144cf93574 Mon Sep 17 00:00:00 2001 From: Mark Ingram Date: Tue, 2 Apr 2024 09:24:43 +0100 Subject: [PATCH] trace: adds back call to classify_eos on trailers - was dropped in the http-body 1.0 upgrade --- tower-http/src/trace/body.rs | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tower-http/src/trace/body.rs b/tower-http/src/trace/body.rs index d713f243..32d6d8eb 100644 --- a/tower-http/src/trace/body.rs +++ b/tower-http/src/trace/body.rs @@ -62,6 +62,13 @@ where let frame = match frame.into_trailers() { Ok(trailers) => { + if let Some((classify_eos, mut on_failure)) = + this.classify_eos.take().zip(this.on_failure.take()) + { + if let Err(failure_class) = classify_eos.classify_eos(Some(&trailers)) { + on_failure.on_failure(failure_class, latency, this.span); + } + } if let Some((on_eos, stream_start)) = this.on_eos.take() { on_eos.on_eos(Some(&trailers), stream_start.elapsed(), this.span); }