sends-report-on-success-with-subdomain-policy.https.html (1321B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title> 5 Test that NEL reports are sent for successful requests 6 </title> 7 <script src='/resources/testharness.js'></script> 8 <script src='/resources/testharnessreport.js'></script> 9 <script src='./support/nel.sub.js'></script> 10 </head> 11 <body> 12 <script> 13 nel_test(async t => { 14 // Make a request to a resource whose response headers include an 15 // include_subdomains NEL policy. 16 await fetchResourceWithIncludeSubdomainsPolicy(); 17 // That policy should apply to the request that delivered it. Even though 18 // the policy has include_subdomains set, it SHOULD generate a full, 19 // non-downgraded report about the request, since the request has the 20 // same origin as the policy. (I.e., since the origins are the same, the 21 // include_subdomains setting is irrelevant.) 22 assert_true(await reportExists({ 23 url: getURLForResourceWithIncludeSubdomainsPolicy(), 24 user_agent: navigator.userAgent, 25 type: "network-error", 26 body: { 27 method: "GET", 28 sampling_fraction: 1.0, 29 status_code: 200, 30 phase: "application", 31 type: "ok", 32 }, 33 metadata: { 34 content_type: "application/reports+json", 35 }, 36 })); 37 }); 38 </script> 39 </body> 40 </html>