fix(http1): ending close-delimited body should close (#2322)

Signed-off-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
Eliza Weisman
2020-11-06 15:38:01 -08:00
committed by GitHub
parent 1b9af22fa0
commit 71f3402421
2 changed files with 13 additions and 4 deletions

View File

@@ -81,6 +81,13 @@ impl Encoder {
self.is_last
}
pub fn is_close_delimited(&self) -> bool {
match self.kind {
Kind::CloseDelimited => true,
_ => false,
}
}
pub fn end<B>(&self) -> Result<Option<EncodedBuf<B>>, NotEof> {
match self.kind {
Kind::Length(0) => Ok(None),