Skip to content

Commit b7373b4

Browse files
authored
Fetch: basic syntax tests for Cross-Origin-Resource-Policy
Supplements web-platform-tests#11171. For whatwg/fetch#733.
1 parent 7c0611d commit b7373b4

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// META: script=/common/get-host-info.sub.js
2+
3+
const crossOriginURL = get_host_info().HTTP_REMOTE_ORIGIN + "/fetch/cross-origin-resource-policy/resources/hello.py?corp=";
4+
5+
[
6+
"same",
7+
"same, same-origin",
8+
"SAME-ORIGIN",
9+
"Same-Origin",
10+
"same-origin, <>",
11+
"same-origin, same-origin"
12+
].forEach(incorrectHeaderValue => {
13+
// Note: an incorrect value results in a successful load, so this test is only meaningful in
14+
// implementations with support for the header.
15+
promise_test(t => {
16+
return fetch(crossOriginURL + encodeURIComponent(incorrectHeaderValue), { mode: "no-cors" });
17+
}, "Parsing Cross-Origin-Resource-Policy: " + incorrectHeaderValue);
18+
});

0 commit comments

Comments
 (0)