diff options
Diffstat (limited to 'testing/web-platform/tests/xhr/access-control-basic-allow-non-cors-safelisted-method.any.js')
-rw-r--r-- | testing/web-platform/tests/xhr/access-control-basic-allow-non-cors-safelisted-method.any.js | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/testing/web-platform/tests/xhr/access-control-basic-allow-non-cors-safelisted-method.any.js b/testing/web-platform/tests/xhr/access-control-basic-allow-non-cors-safelisted-method.any.js new file mode 100644 index 0000000000..f238f0d305 --- /dev/null +++ b/testing/web-platform/tests/xhr/access-control-basic-allow-non-cors-safelisted-method.any.js @@ -0,0 +1,14 @@ +// META: title=Tests cross-origin request with non-CORS-safelisted method +// META: script=/common/get-host-info.sub.js + + test(function() { + const xhr = new XMLHttpRequest; + + xhr.open("PUT", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-put-allow.py", false); + + xhr.setRequestHeader("Content-Type", "text/plain; charset=UTF-8"); + + xhr.send("PASS: PUT data received"); + + assert_equals(xhr.responseText, "PASS: Cross-domain access allowed.\nPASS: PUT data received"); + }, "Allow PUT request"); |