We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c1e537c commit 4bffeccCopy full SHA for 4bffecc
body-plz/src/reader/chunked_reader.rs
@@ -133,8 +133,12 @@ impl ChunkReader {
133
}
134
135
Self::EndCRLF => {
136
- if buf.remaining() == CRLF.as_bytes() {
137
- buf.set_position(buf.position() + 2);
+ if let Some(index) = buf
+ .remaining()
138
+ .windows(2)
139
+ .position(|window| window == CRLF.as_bytes())
140
+ {
141
+ buf.set_position(index + 2);
142
*self = Self::End;
143
Some(ChunkedBody::EndCRLF(buf.split_at_current_pos()))
144
} else {
0 commit comments