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 5aafae7
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions .idea/inspectionProfiles/Project_Default.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

43 changes: 43 additions & 0 deletions .idea/tonic.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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 5aafae7

Please sign in to comment.