summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/network-error-logging/no-report-on-subdomain-success.https.html
blob: 5fd6d4fb41231c5ca5f345b890927c5d1b9411ab (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
27
28
29
30
<!DOCTYPE HTML>
<html>
<head>
  <title>
    Test that include_subdomains policies do NOT report successful requests
  </title>
  <script src='/resources/testharness.js'></script>
  <script src='/resources/testharnessreport.js'></script>
  <script src='./support/nel.sub.js'></script>
</head>
<body>
  <script>
    nel_test(async t => {
      // Make a request to a resource whose response headers include an
      // include_subdomains NEL policy.
      await fetchResourceWithIncludeSubdomainsPolicy();
      // Make a request to another resource on a subdomain of the above, which
      // does not define its own NEL policy.
      await fetchResourceWithNoPolicy('www');
      // The include_subdomains policy that we just received should NOT cover
      // the second request, since include_subdomains policies can only report
      // on DNS errors.
      assert_false(await reportExists({
        url: getURLForResourceWithNoPolicy('www'),
        type: "network-error",
      }));
    });
  </script>
</body>
</html>