mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-24 00:21:08 +01:00
add octal-ish CL test
This commit is contained in:
parent
40eab1f091
commit
c0d5d7bdb5
@ -964,12 +964,20 @@ mod tests {
|
|||||||
"GET /test HTTP/1.1\r\n\
|
"GET /test HTTP/1.1\r\n\
|
||||||
content-length: -1\r\n\r\n",
|
content-length: -1\r\n\r\n",
|
||||||
));
|
));
|
||||||
|
}
|
||||||
|
|
||||||
// octal CL
|
#[test]
|
||||||
// expect_parse_err!(&mut BytesMut::from(
|
fn octal_ish_cl_parsed_as_decimal() {
|
||||||
// "GET /test HTTP/1.1\r\n\
|
let mut buf = BytesMut::from(
|
||||||
// content-length: 0123\r\n\r\n",
|
"POST /test HTTP/1.1\r\n\
|
||||||
// ));
|
content-length: 011\r\n\r\n",
|
||||||
|
);
|
||||||
|
let mut reader = MessageDecoder::<Request>::default();
|
||||||
|
let (_req, pl) = reader.decode(&mut buf).unwrap().unwrap();
|
||||||
|
assert!(matches!(
|
||||||
|
pl,
|
||||||
|
PayloadType::Payload(pl) if pl == PayloadDecoder::length(11)
|
||||||
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user