Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /fetch/api/cors/cors-multiple-origins.sub.any.html - WPT Dashboard Interop Dashboard
- /fetch/api/cors/cors-multiple-origins.sub.any.serviceworker.html - WPT Dashboard Interop Dashboard
- /fetch/api/cors/cors-multiple-origins.sub.any.sharedworker.html - WPT Dashboard Interop Dashboard
- /fetch/api/cors/cors-multiple-origins.sub.any.worker.html - WPT Dashboard Interop Dashboard
// META: global=window,worker
// META: script=../resources/utils.js
function corsMultipleOrigins(originList) {
var urlParameters = "?origin=" + encodeURIComponent(originList.join(", "));
var url = "http://{{host}}:{{ports[http][1]}}" + dirname(location.pathname) + RESOURCES_DIR + "preflight.py";
promise_test(function(test) {
return promise_rejects_js(test, TypeError, fetch(url + urlParameters));
}, "Listing multiple origins is illegal: " + originList);
}
/* Actual origin */
corsMultipleOrigins(["\"\"", origin, origin]);
done();