summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/xhr/access-control-basic-allow-access-control-origin-header.any.js
blob: 12b9cf21b28c87ab67e0742547bd03e91033a905 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// META: title=Access control test with origin header
// META: script=/common/get-host-info.sub.js

    async_test(function(test) {
      const xhr = new XMLHttpRequest;

      xhr.open("GET", get_host_info().HTTP_REMOTE_ORIGIN + "/xhr/resources/access-control-origin-header.py", false);
      xhr.send();

      assert_equals(xhr.responseText, "PASS: Cross-domain access allowed.\n" +
          "HTTP_ORIGIN: " + get_host_info().HTTP_ORIGIN);
      test.done();
    }, "Access control test with origin header");