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

@ -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
}
}