Skip to content

Commit

Permalink
fix(web): fix empty trailer parsing causing infinite parser loop
Browse files Browse the repository at this point in the history
  • Loading branch information
zak-cloudnc committed Aug 22, 2024
1 parent 46d8c2d commit 315c9c2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tonic-web/src/call.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,10 @@ where
}
FindTrailers::IncompleteBuf => continue,
FindTrailers::Done(len) => {
Poll::Ready(Some(Ok(Frame::data(buf.split_to(len).freeze()))))
Poll::Ready(match len {
0 => None,
_ => Some(Ok(Frame::data(buf.split_to(len).freeze()))),
})
}
};
}
Expand Down

0 comments on commit 315c9c2

Please sign in to comment.