mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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
|
@ -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