mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Upgrade to Hyper 0.4.0
This commit is contained in:
parent
f4381a6f1e
commit
8292f5749e
12 changed files with 97 additions and 39 deletions
|
@ -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"
|
||||
|
|
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue