referrer.https.sub.html (1104B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>HTTPS Upgrades: Upgrade.</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script src="/common/get-host-info.sub.js"></script> 8 9 <meta name="referrer" content="no-referrer-when-downgrade" /> 10 11 </head> 12 <body> 13 <script> 14 setup({ single_test: true }); 15 // When the referrer policy is no-referrer-when-downgrade, HTTPS upgrades should not drop 16 // the referrer upon navigating to an HTTP URL if the upgrade is successful. 17 18 // HTTPS upgrades don't change custom ports, so this will load correctly if an HTTPS upgrade is performed, 19 // and will fail to load otherwise (since the port will be wrong for http). 20 var url = new URL("http://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass-with-referrer.html") 21 window.onmessage = function(event) { 22 if (event.data['pass'] && event.data['referrer'] == document.location.href) { 23 done(); 24 } 25 } 26 win = window.open(url) 27 </script> 28 </body> 29 </html>