aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/cors.rs
diff options
context:
space:
mode:
authorSimon Sapin <simon.sapin@exyr.org>2015-05-12 16:48:21 +0200
committerSimon Sapin <simon.sapin@exyr.org>2015-05-12 16:48:21 +0200
commit8292f5749ee0fb2159dc0ed212d9889e63e6c1fc (patch)
tree88b6531827b73e870a06eb7259f1c1075fe01f17 /components/script/cors.rs
parentf4381a6f1e4d42b316d67337a4c69913df2f51d2 (diff)
downloadservo-8292f5749ee0fb2159dc0ed212d9889e63e6c1fc.tar.gz
servo-8292f5749ee0fb2159dc0ed212d9889e63e6c1fc.zip
Upgrade to Hyper 0.4.0
Diffstat (limited to 'components/script/cors.rs')
-rw-r--r--components/script/cors.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/components/script/cors.rs b/components/script/cors.rs
index cd7d0828564..0a0660c3d18 100644
--- a/components/script/cors.rs
+++ b/components/script/cors.rs
@@ -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
}
}