Skip to content

Commit 8fb33ec

Browse files
annevkjgraham
authored andcommitted
Bug 1467848 [wpt PR 11428] - Fetch: test Cross-Origin-Resource-Policy: same-site's scheme restriction, a=testonly
Automatic update from web-platform-testsFetch: test Cross-Origin-Resource-Policy: same-site's scheme restriction Supplements #11171. For whatwg/fetch#733. -- wpt-commits: 7f0a106f3d5e9d3e7f70ba52aae896a3fffc2cc6 wpt-pr: 11428
1 parent bf2444f commit 8fb33ec

File tree

4 files changed

+45
-2
lines changed

4 files changed

+45
-2
lines changed

testing/web-platform/meta/MANIFEST.json

+25-1
Original file line numberDiff line numberDiff line change
@@ -338943,6 +338943,22 @@
338943338943
{}
338944338944
]
338945338945
],
338946+
"fetch/cross-origin-resource-policy/scheme-restriction.any.js": [
338947+
[
338948+
"/fetch/cross-origin-resource-policy/scheme-restriction.any.html",
338949+
{}
338950+
],
338951+
[
338952+
"/fetch/cross-origin-resource-policy/scheme-restriction.any.worker.html",
338953+
{}
338954+
]
338955+
],
338956+
"fetch/cross-origin-resource-policy/scheme-restriction.https.window.js": [
338957+
[
338958+
"/fetch/cross-origin-resource-policy/scheme-restriction.https.window.html",
338959+
{}
338960+
]
338961+
],
338946338962
"fetch/cross-origin-resource-policy/script-loads.html": [
338947338963
[
338948338964
"/fetch/cross-origin-resource-policy/script-loads.html",
@@ -569233,7 +569249,7 @@
569233569249
"support"
569234569250
],
569235569251
"fetch/cross-origin-resource-policy/resources/image.py": [
569236-
"72f4bbf045fbb61623246d44b763bd06024c0f63",
569252+
"1eba6cc92e4bc3f0d83814c0ead1ba6b23aa5182",
569237569253
"support"
569238569254
],
569239569255
"fetch/cross-origin-resource-policy/resources/redirect.py": [
@@ -569244,6 +569260,14 @@
569244569260
"330a0ae1420b41e63bd639fa24f75e64e4528bcc",
569245569261
"support"
569246569262
],
569263+
"fetch/cross-origin-resource-policy/scheme-restriction.any.js": [
569264+
"e1221ddd258f4d699dad395284f7a2cb0a719888",
569265+
"testharness"
569266+
],
569267+
"fetch/cross-origin-resource-policy/scheme-restriction.https.window.js": [
569268+
"e0272587c66b6c220dce1a5a055d49628c84d0fd",
569269+
"testharness"
569270+
],
569247569271
"fetch/cross-origin-resource-policy/script-loads.html": [
569248569272
"cd28267293f2d20ee78d6b946fe6b8793edf1bae",
569249569273
"testharness"

testing/web-platform/tests/fetch/cross-origin-resource-policy/resources/image.py

-1
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ def main(request, response):
1818
response.writer.end_headers()
1919

2020
response.writer.write(body)
21-
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
// META: script=/common/get-host-info.sub.js
2+
3+
promise_test(t => {
4+
return promise_rejects(t,
5+
new TypeError(),
6+
fetch(get_host_info().HTTPS_REMOTE_ORIGIN + "/fetch/cross-origin-resource-policy/resources/hello.py?corp=same-site", { mode: "no-cors" }));
7+
}, "Cross-Origin-Resource-Policy: same-site blocks retrieving HTTPS from HTTP");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// META: script=/common/get-host-info.sub.js
2+
3+
promise_test(t => {
4+
const img = new Image();
5+
img.src = get_host_info().HTTP_REMOTE_ORIGIN + "/fetch/cross-origin-resource-policy/resources/image.py?corp=same-site";
6+
return new Promise((resolve, reject) => {
7+
img.onload = resolve;
8+
img.onerror = reject;
9+
document.body.appendChild(img);
10+
}).finally(() => {
11+
img.remove();
12+
});
13+
}, "Cross-Origin-Resource-Policy does not block Mixed Content <img>");

0 commit comments

Comments
 (0)