https://github.com/web-platform-tests/wpt
Raw File
Tip revision: 2a0948b43d6af3d822f979a51179b4220e3d0864 authored by Robert Ma on 16 March 2018, 00:32:55 UTC
Pass the binary path of Chrome to wpt run in CI
Tip revision: 2a0948b
access-control-basic-post-success-no-content-type.htm
<!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>
back to top