multiple-headers-one-invalid.html (1379B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>Referrer Policy: multiple Referrer-Policy headers with one invalid</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 8 <script src="/common/security-features/resources/common.sub.js"></script> 9 </head> 10 <body> 11 <h1>Referrer Policy: multiple Referrer-Policy headers with one invalid</h1> 12 <p></p> 13 14 <pre id="received_message">Running...</pre> 15 16 <script> 17 promise_test(() => { 18 var urlPath = '/common/security-features/subresource/image.py?cache_destroyer=' + (new Date()).getTime(); 19 // The default referrer policy is strict-origin-when-cross-origin. 20 // This document's headers contain the 'origin' and 'no-referrer' tokens, 21 // and we're making a same-origin image load, so, if the image request, 22 // uses the default policy (which is what this test's verifying), we 23 // should see the full initiating URL in the referrer, rather than just 24 // the origin or an empty string. 25 return requestViaImage(urlPath, null, 'no-referrer') 26 .then(function(message) { 27 assert_equals(message.referrer, document.location.href); 28 }); 29 }, "Referrer policy header parsing fails if one header is invalid"); 30 </script> 31 32 <div id="log"></div> 33 </body> 34 </html>