blob: 7e7a7d3a3e8191946e6fdb5f2a8c5738071af305 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<!DOCTYPE html>
<html>
<head>
<title>Tests that POST requests with text content and no content-type set explicitly don't generate a preflight request.</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/get-host-info.sub.js"></script>
</head>
<body>
<script type="text/javascript">
async_test(function(test) {
const xhr = new XMLHttpRequest;
xhr.open("POST", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-basic-options-not-supported.py");
xhr.onerror = test.unreached_func("Network error.");
xhr.onload = test.step_func_done(function() {
assert_equals(xhr.status, 200);
});
xhr.send("Test");
}, "POST request with text content and no Content-Type header");
</script>
</body>
</html>
|