cargo fmt
This commit is contained in:
@@ -284,5 +284,4 @@ mod tests {
|
||||
request.set("Foo", "Bar");
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ impl Payload {
|
||||
let len = bytes.len();
|
||||
let cursor = Cursor::new(bytes);
|
||||
SizedReader::new(Some(len), Box::new(cursor))
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use std::io::Error as IoError;
|
||||
use std::fmt;
|
||||
use std::io::Error as IoError;
|
||||
|
||||
/// Errors that are translated to ["synthetic" responses](struct.Response.html#method.synthetic).
|
||||
#[derive(Debug)]
|
||||
|
||||
@@ -4,10 +4,10 @@ use std::net::TcpStream;
|
||||
use std::net::ToSocketAddrs;
|
||||
use std::time::Duration;
|
||||
|
||||
#[cfg(feature = "tls")]
|
||||
use rustls::StreamOwned;
|
||||
#[cfg(feature = "tls")]
|
||||
use rustls::ClientSession;
|
||||
#[cfg(feature = "tls")]
|
||||
use rustls::StreamOwned;
|
||||
|
||||
use crate::error::Error;
|
||||
use crate::unit::Unit;
|
||||
@@ -72,7 +72,10 @@ impl Read for Stream {
|
||||
}
|
||||
|
||||
#[cfg(feature = "tls")]
|
||||
fn read_https(stream: &mut StreamOwned<ClientSession, TcpStream>, buf: &mut [u8]) -> IoResult<usize> {
|
||||
fn read_https(
|
||||
stream: &mut StreamOwned<ClientSession, TcpStream>,
|
||||
buf: &mut [u8],
|
||||
) -> IoResult<usize> {
|
||||
match stream.read(buf) {
|
||||
Ok(size) => Ok(size),
|
||||
Err(ref e) if is_close_notify(e) => Ok(0),
|
||||
|
||||
@@ -4,7 +4,8 @@ use std::io::Read;
|
||||
#[test]
|
||||
fn tls_connection_close() {
|
||||
let agent = ureq::Agent::default().build();
|
||||
let resp = agent.get("https://example.com/404")
|
||||
let resp = agent
|
||||
.get("https://example.com/404")
|
||||
.set("Connection", "close")
|
||||
.call();
|
||||
assert_eq!(resp.status(), 404);
|
||||
|
||||
Reference in New Issue
Block a user