Skip to content

Commit

Permalink
compression: the identity body should respect is_end_stream
Browse files Browse the repository at this point in the history
This breaks certain gRPC failure scenarios when not compressing.

Signed-off-by: Matt Klein <[email protected]>
  • Loading branch information
mattklein123 committed Dec 18, 2024
1 parent 93d31c1 commit 7ec55d4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tower-http/src/compression/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -277,6 +277,14 @@ where
http_body::SizeHint::new()
}
}

fn is_end_stream(&self) -> bool {
if let BodyInner::Identity { inner } = &self.inner {
inner.is_end_stream()
} else {
false
}
}
}

#[cfg(feature = "compression-gzip")]
Expand Down

0 comments on commit 7ec55d4

Please sign in to comment.