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.
TcpStream::read_bytes
TcpStream::read_exact
1 parent 244d772 commit 83cd488Copy full SHA for 83cd488
src/http/server/request.rs
@@ -372,7 +372,7 @@ impl Request {
372
// Read body if its length is specified
373
match request.headers.content_length {
374
Some(length) => {
375
- match buffer.read_bytes(length) {
+ match buffer.read_exact(length) {
376
Ok(body) => match str::from_utf8(body) {
377
Some(body_str) => request.body = body_str.to_owned(),
378
None => return (request, Err(status::BadRequest))
0 commit comments