fix(client): don't assume bodies on 204 and 304 Responses

Closes #1242
This commit is contained in:
Sean McArthur
2017-07-04 12:42:02 -07:00
parent 7ce3121132
commit 81c0d185bd
2 changed files with 45 additions and 8 deletions

View File

@@ -11,7 +11,7 @@ use self::Kind::{Length, Chunked, Eof};
///
/// If a message body does not include a Transfer-Encoding, it *should*
/// include a Content-Length header.
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
pub struct Decoder {
kind: Kind,
}
@@ -30,7 +30,7 @@ impl Decoder {
}
}
#[derive(Debug, Clone)]
#[derive(Debug, Clone, PartialEq)]
enum Kind {
/// A Reader used when a Content-Length header is passed with a positive integer.
Length(u64),