summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/xhr/content-type-unmodified.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/xhr/content-type-unmodified.any.js')
-rw-r--r--testing/web-platform/tests/xhr/content-type-unmodified.any.js16
1 files changed, 16 insertions, 0 deletions
diff --git a/testing/web-platform/tests/xhr/content-type-unmodified.any.js b/testing/web-platform/tests/xhr/content-type-unmodified.any.js
new file mode 100644
index 0000000000..92705d6e9b
--- /dev/null
+++ b/testing/web-platform/tests/xhr/content-type-unmodified.any.js
@@ -0,0 +1,16 @@
+"use strict";
+
+async_test(t => {
+ const xhr = new XMLHttpRequest();
+
+ xhr.open("POST", "resources/echo-content-type.py");
+ xhr.setRequestHeader("content-type", "application/json; charset=UTF-8");
+
+ xhr.onerror = t.unreached_func("Error occurred.");
+
+ xhr.onload = t.step_func_done(() => {
+ assert_equals(xhr.status, 200);
+ assert_equals(xhr.responseText, "application/json; charset=UTF-8");
+ });
+ xhr.send("{ \"x\":\"a\"}");
+});