diff --git a/src/stream.rs b/src/stream.rs index e39406a..8c5641e 100644 --- a/src/stream.rs +++ b/src/stream.rs @@ -7,8 +7,6 @@ use std::net::TcpStream; use std::net::ToSocketAddrs; use std::time::Duration; -#[cfg(feature = "tls")] -use native_tls::TlsConnector; #[cfg(feature = "tls")] use native_tls::TlsStream; @@ -76,7 +74,8 @@ pub fn connect_http(unit: &Unit) -> Result { #[cfg(feature = "tls")] pub fn connect_https(unit: &Unit) -> Result { - // + use native_tls::TlsConnector; + let hostname = unit.url.host_str().unwrap(); let port = unit.url.port().unwrap_or(443); diff --git a/src/test/mod.rs b/src/test/mod.rs index d30575c..0c77684 100644 --- a/src/test/mod.rs +++ b/src/test/mod.rs @@ -2,7 +2,7 @@ use agent::Unit; use error::Error; use header::Header; use std::collections::HashMap; -use std::io::{Write, Cursor}; +use std::io::{Cursor, Write}; use std::sync::{Arc, Mutex}; use stream::Stream; diff --git a/src/unit.rs b/src/unit.rs index 7cb15d7..b61f8d2 100644 --- a/src/unit.rs +++ b/src/unit.rs @@ -196,12 +196,14 @@ impl Unit { fn match_cookies<'a>(jar: &'a CookieJar, domain: &str, path: &str, is_secure: bool) -> Vec
{ jar.iter() .filter(|c| { - // if there is a domain, it must be matched. if there is no domain, then ignore cookie + // if there is a domain, it must be matched. + // if there is no domain, then ignore cookie let domain_ok = c .domain() .map(|cdom| domain.contains(cdom)) .unwrap_or(false); - // a path must match the beginning of request path. no cookie path, we say is ok. is it?! + // a path must match the beginning of request path. + // no cookie path, we say is ok. is it?! let path_ok = c .path() .map(|cpath| path.find(cpath).map(|pos| pos == 0).unwrap_or(false))