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 26a939b
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 26a939b

Please sign in to comment.