aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/headers.rs6
-rw-r--r--components/script/dom/request.rs3
-rw-r--r--tests/wpt/metadata/fetch/api/basic/accept-header.any.js.ini17
-rw-r--r--tests/wpt/metadata/fetch/api/cors/cors-preflight-star.any.js.ini6
-rw-r--r--tests/wpt/metadata/fetch/api/cors/cors-preflight.any.js.ini18
-rw-r--r--tests/wpt/metadata/fetch/api/cors/cors-redirect-preflight.any.js.ini185
-rw-r--r--tests/wpt/metadata/fetch/api/credentials/authentication-basic.any.js.ini23
7 files changed, 9 insertions, 249 deletions
diff --git a/components/script/dom/headers.rs b/components/script/dom/headers.rs
index 5d152ab93bb..b351e2b7f13 100644
--- a/components/script/dom/headers.rs
+++ b/components/script/dom/headers.rs
@@ -234,6 +234,12 @@ impl Headers {
*self.header_list.borrow_mut() = hyper_headers;
}
+ pub fn get_headers_list(&self) -> HyperHeaders {
+ let mut headers = HyperHeaders::new();
+ headers.extend(self.header_list.borrow_mut().iter());
+ headers
+ }
+
// https://fetch.spec.whatwg.org/#concept-header-extract-mime-type
pub fn extract_mime_type(&self) -> Vec<u8> {
self.header_list.borrow().get_raw("content-type").map_or(vec![], |v| v[0].clone())
diff --git a/components/script/dom/request.rs b/components/script/dom/request.rs
index f0b28f59b69..fcd396c1176 100644
--- a/components/script/dom/request.rs
+++ b/components/script/dom/request.rs
@@ -339,6 +339,9 @@ impl Request {
_ => {},
}
+ // Copy the headers list onto the headers of net_traits::Request
+ r.request.borrow_mut().headers = r.Headers().get_headers_list();
+
// Step 32
let mut input_body = if let RequestInfo::Request(ref input_request) = input {
let input_request_request = input_request.request.borrow();
diff --git a/tests/wpt/metadata/fetch/api/basic/accept-header.any.js.ini b/tests/wpt/metadata/fetch/api/basic/accept-header.any.js.ini
deleted file mode 100644
index fba2dac22d3..00000000000
--- a/tests/wpt/metadata/fetch/api/basic/accept-header.any.js.ini
+++ /dev/null
@@ -1,17 +0,0 @@
-[accept-header.any.html]
- type: testharness
- [Request through fetch should have 'accept' header with value 'custom/*']
- expected: FAIL
-
- [Request through fetch should have 'accept-language' header with value 'bzh']
- expected: FAIL
-
-
-[accept-header.any.worker.html]
- type: testharness
- [Request through fetch should have 'accept' header with value 'custom/*']
- expected: FAIL
-
- [Request through fetch should have 'accept-language' header with value 'bzh']
- expected: FAIL
-
diff --git a/tests/wpt/metadata/fetch/api/cors/cors-preflight-star.any.js.ini b/tests/wpt/metadata/fetch/api/cors/cors-preflight-star.any.js.ini
index 385bc215a33..b99585d72cb 100644
--- a/tests/wpt/metadata/fetch/api/cors/cors-preflight-star.any.js.ini
+++ b/tests/wpt/metadata/fetch/api/cors/cors-preflight-star.any.js.ini
@@ -6,12 +6,6 @@
[CORS that succeeds with credentials: false; method: OK (allowed: *); header: X-Test,1 (allowed: *)]
expected: FAIL
- [CORS that fails with credentials: true; method: GET (allowed: get); header: X-Test,1 (allowed: *)]
- expected: FAIL
-
- [CORS that fails with credentials: true; method: GET (allowed: *); header: X-Test,1 (allowed: *)]
- expected: FAIL
-
[CORS that succeeds with credentials: true; method: PUT (allowed: PUT); header: (allowed: *)]
expected: FAIL
diff --git a/tests/wpt/metadata/fetch/api/cors/cors-preflight.any.js.ini b/tests/wpt/metadata/fetch/api/cors/cors-preflight.any.js.ini
index 6729fb6e75e..5f6b56e0621 100644
--- a/tests/wpt/metadata/fetch/api/cors/cors-preflight.any.js.ini
+++ b/tests/wpt/metadata/fetch/api/cors/cors-preflight.any.js.ini
@@ -6,18 +6,9 @@
[CORS [NEW\], server allows]
expected: FAIL
- [CORS [GET\] [x-test-header: allowed\], server allows]
- expected: FAIL
-
- [CORS [GET\] [x-test-header: refused\], server refuses]
- expected: FAIL
-
[CORS [GET\] [several headers\], server allows]
expected: FAIL
- [CORS [GET\] [several headers\], server refuses]
- expected: FAIL
-
[CORS [PUT\] [several headers\], server allows]
expected: FAIL
@@ -30,18 +21,9 @@
[CORS [NEW\], server allows]
expected: FAIL
- [CORS [GET\] [x-test-header: allowed\], server allows]
- expected: FAIL
-
- [CORS [GET\] [x-test-header: refused\], server refuses]
- expected: FAIL
-
[CORS [GET\] [several headers\], server allows]
expected: FAIL
- [CORS [GET\] [several headers\], server refuses]
- expected: FAIL
-
[CORS [PUT\] [several headers\], server allows]
expected: FAIL
diff --git a/tests/wpt/metadata/fetch/api/cors/cors-redirect-preflight.any.js.ini b/tests/wpt/metadata/fetch/api/cors/cors-redirect-preflight.any.js.ini
deleted file mode 100644
index 7b17b5619f6..00000000000
--- a/tests/wpt/metadata/fetch/api/cors/cors-redirect-preflight.any.js.ini
+++ /dev/null
@@ -1,185 +0,0 @@
-[cors-redirect-preflight.any.html]
- type: testharness
- [Redirect 301: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 301: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 301: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 301: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 301: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 301: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 302: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 302: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 302: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 302: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 302: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 302: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 303: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 303: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 303: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 303: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 303: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 303: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 307: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 307: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 307: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 307: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 307: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 307: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 308: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 308: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 308: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 308: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 308: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 308: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
-
-[cors-redirect-preflight.any.worker.html]
- type: testharness
- [Redirect 301: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 301: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 301: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 301: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 301: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 301: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 302: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 302: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 302: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 302: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 302: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 302: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 303: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 303: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 303: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 303: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 303: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 303: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 307: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 307: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 307: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 307: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 307: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 307: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 308: same origin to cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 308: same origin to cors (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 308: cors to same origin (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 308: cors to same origin (preflight after redirection failure case)]
- expected: FAIL
-
- [Redirect 308: cors to another cors (preflight after redirection success case)]
- expected: FAIL
-
- [Redirect 308: cors to another cors (preflight after redirection failure case)]
- expected: FAIL
-
diff --git a/tests/wpt/metadata/fetch/api/credentials/authentication-basic.any.js.ini b/tests/wpt/metadata/fetch/api/credentials/authentication-basic.any.js.ini
deleted file mode 100644
index 55038e25b7a..00000000000
--- a/tests/wpt/metadata/fetch/api/credentials/authentication-basic.any.js.ini
+++ /dev/null
@@ -1,23 +0,0 @@
-[authentication-basic.any.html]
- type: testharness
- [User-added Authorization header with include mode]
- expected: FAIL
-
- [User-added Authorization header with same-origin mode]
- expected: FAIL
-
- [User-added Authorization header with omit mode]
- expected: FAIL
-
-
-[authentication-basic.any.worker.html]
- type: testharness
- [User-added Authorization header with include mode]
- expected: FAIL
-
- [User-added Authorization header with same-origin mode]
- expected: FAIL
-
- [User-added Authorization header with omit mode]
- expected: FAIL
-