Upgrade to Hyper 0.4.0

This commit is contained in:
Simon Sapin 2015-05-12 16:48:21 +02:00
parent f4381a6f1e
commit 8292f5749e
12 changed files with 97 additions and 39 deletions

View file

@ -20,4 +20,4 @@ path = "../util"
time = "*"
rustc-serialize = "0.3"
url = "*"
hyper = "*"
hyper = "0.4"

View file

@ -17,4 +17,4 @@ path = "../util"
time = "*"
rustc-serialize = "0.3"
url = "*"
hyper = "*"
hyper = "0.4"

View file

@ -38,4 +38,4 @@ git = "https://github.com/servo/rust-png"
[dependencies]
url = "0.2.16"
bitflags = "*"
hyper = "0.3"
hyper = "0.4"

View file

@ -30,6 +30,6 @@ rustc-serialize = "0.3"
cookie="*"
regex = "0.1.14"
regex_macros = "0.1.8"
hyper = "0.3"
hyper = "0.4"
flate2 = "0.2.0"
uuid = "0.1.16"

View file

@ -14,7 +14,7 @@ use file_loader;
use flate2::read::{DeflateDecoder, GzDecoder};
use hyper::client::Request;
use hyper::header::{AcceptEncoding, Accept, ContentLength, ContentType, Host, Location, qitem, Quality, QualityItem};
use hyper::HttpError;
use hyper::Error as HttpError;
use hyper::method::Method;
use hyper::mime::{Mime, TopLevel, SubLevel};
use hyper::net::HttpConnector;
@ -135,7 +135,7 @@ reason: \"certificate verify failed\" }]))";
let mut req = match Request::with_connector(load_data.method.clone(), url.clone(), &mut connector) {
Ok(req) => req,
Err(HttpError::HttpIoError(ref io_error)) if (
Err(HttpError::Io(ref io_error)) if (
io_error.kind() == io::ErrorKind::Other &&
io_error.description() == "Error in OpenSSL" &&
// FIXME: This incredibly hacky. Make it more robust, and at least test it.

View file

@ -24,4 +24,4 @@ git = "https://github.com/servo/rust-stb-image"
[dependencies]
url = "0.2.16"
hyper = "0.3"
hyper = "0.4"

View file

@ -73,7 +73,7 @@ time = "0.1.12"
bitflags = "*"
rustc-serialize = "*"
libc = "*"
hyper = "0.3"
hyper = "0.4"
cssparser = "0.3.1"
unicase = "0.1"
num = "0.1.24"

View file

@ -445,13 +445,14 @@ fn is_simple_method(m: &Method) -> bool {
/// Perform a CORS check on a header list and CORS request
/// https://fetch.spec.whatwg.org/#cors-check
pub fn allow_cross_origin_request(req: &CORSRequest, headers: &Headers) -> bool {
//FIXME(seanmonstar): use req.headers.get::<AccessControlAllowOrigin>()
match headers.get() {
match headers.get::<AccessControlAllowOrigin>() {
Some(&AccessControlAllowOrigin::Any) => true, // Not always true, depends on credentials mode
// FIXME: https://github.com/servo/servo/issues/6020
Some(&AccessControlAllowOrigin::Value(ref url)) =>
url.scheme == req.origin.scheme &&
url.host() == req.origin.host() &&
url.port() == req.origin.port(),
Some(&AccessControlAllowOrigin::Null) |
None => false
}
}

View file

@ -190,7 +190,7 @@ name = "devtools"
version = "0.0.1"
dependencies = [
"devtools_traits 0.0.1",
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
@ -202,7 +202,7 @@ dependencies = [
name = "devtools_traits"
version = "0.0.1"
dependencies = [
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
@ -564,6 +564,25 @@ dependencies = [
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "hyper"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.0.10 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)",
"traitobject 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "io_surface"
version = "0.1.0"
@ -747,7 +766,7 @@ dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core_foundation 0.1.0 (git+https://github.com/servo/rust-core-foundation)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"io_surface 0.1.0 (git+https://github.com/servo/rust-io-surface)",
"layers 0.1.0 (git+https://github.com/servo/rust-layers)",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
@ -765,7 +784,7 @@ dependencies = [
"devtools_traits 0.0.1",
"flate2 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"net_traits 0.0.1",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
@ -783,7 +802,7 @@ name = "net_tests"
version = "0.0.1"
dependencies = [
"cookie 0.1.19 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"net 0.0.1",
"net_traits 0.0.1",
"url 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)",
@ -795,7 +814,7 @@ name = "net_traits"
version = "0.0.1"
dependencies = [
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
"png 0.1.0 (git+https://github.com/servo/rust-png)",
"stb_image 0.1.0 (git+https://github.com/servo/rust-stb-image)",
@ -1006,7 +1025,7 @@ dependencies = [
"geom 0.1.0 (git+https://github.com/servo/rust-geom)",
"gfx 0.0.1",
"html5ever 0.0.0 (git+https://github.com/servo/html5ever)",
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"js 0.1.0 (git+https://github.com/servo/rust-mozjs)",
"libc 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"msg 0.0.1",
@ -1027,7 +1046,7 @@ dependencies = [
"util 0.0.1",
"uuid 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)",
"webdriver_traits 0.0.1",
"websocket 0.11.8 (registry+https://github.com/rust-lang/crates.io-index)",
"websocket 0.11.10 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@ -1286,12 +1305,12 @@ dependencies = [
[[package]]
name = "websocket"
version = "0.11.8"
version = "0.11.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.3.16 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc-serialize 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)",