This commit is contained in:
Martin Algesten
2018-09-03 11:22:09 +02:00
parent c0384c364b
commit 7ba59abbef
2 changed files with 4 additions and 3 deletions

View File

@@ -1,11 +1,11 @@
use std::io::Error as IoError;
#[cfg(feature = "tls")]
use std::net::TcpStream;
#[cfg(feature = "tls")]
use native_tls::Error as TlsError;
#[cfg(feature = "tls")]
use native_tls::HandshakeError;
#[cfg(feature = "tls")]
use std::net::TcpStream;
/// Errors that are translated to ["synthetic" responses](struct.Response.html#method.synthetic).
#[derive(Debug)]

View File

@@ -251,7 +251,8 @@ impl Response {
//
let is_http10 = self.http_version().eq_ignore_ascii_case("HTTP/1.0");
let is_close = self.header("connection")
let is_close = self
.header("connection")
.map(|c| c.eq_ignore_ascii_case("close"))
.unwrap_or(false);