1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 17:46:38 +02:00

return error on write zero bytes

This commit is contained in:
Nikolay Kim
2018-03-10 10:42:46 -08:00
parent 71b4c07ea4
commit 6c709b33cc
3 changed files with 17 additions and 23 deletions

View File

@@ -196,8 +196,8 @@ mod tests {
let mut req = HttpRequest::default();
req.headers_mut().insert(header::CONTENT_TYPE,
header::HeaderValue::from_static("application/json"));
let mut json = req.json::<MyObject>().content_type("text/json");
header::HeaderValue::from_static("application/text"));
let mut json = req.json::<MyObject>();
assert_eq!(json.poll().err().unwrap(), JsonPayloadError::ContentType);
let mut req = HttpRequest::default();