Skip to content

Commit

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

0 comments on commit f321d6a

Please sign in to comment.