fix(client): GET and HEAD shouldn't add Transfer-Encoding
Also adds an EmptyWriter, used for GET and HEAD requests, which will return an io::ShortWrite error if the user ever tries to write to a GET or HEAD request. Closes #77
This commit is contained in:
@@ -274,19 +274,19 @@ mod tests {
|
||||
|
||||
#[test]
|
||||
fn test_downcast_box_stream() {
|
||||
let stream = box MockStream as Box<NetworkStream + Send>;
|
||||
let stream = box MockStream::new() as Box<NetworkStream + Send>;
|
||||
|
||||
let mock = stream.downcast::<MockStream>().unwrap();
|
||||
assert_eq!(mock, box MockStream);
|
||||
assert_eq!(mock, box MockStream::new());
|
||||
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_downcast_unchecked_box_stream() {
|
||||
let stream = box MockStream as Box<NetworkStream + Send>;
|
||||
let stream = box MockStream::new() as Box<NetworkStream + Send>;
|
||||
|
||||
let mock = unsafe { stream.downcast_unchecked::<MockStream>() };
|
||||
assert_eq!(mock, box MockStream);
|
||||
assert_eq!(mock, box MockStream::new());
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user