sends-report-on-success-v1.https.html (1060B)
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 a NEL 15 // policy. 16 await fetchResourceWithBasicPolicyv1(); 17 // That policy should apply to the request that delivered it, so the 18 // collector should have received a report about the request. 19 assert_true(await reportExists({ 20 url: getURLForResourceWithBasicPolicyv1(), 21 user_agent: navigator.userAgent, 22 type: "network-error", 23 body: { 24 method: "GET", 25 sampling_fraction: 1.0, 26 status_code: 200, 27 phase: "application", 28 type: "ok", 29 }, 30 metadata: { 31 content_type: "application/reports+json", 32 }, 33 })); 34 }); 35 </script> 36 </body> 37 </html>