mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-13 20:14:57 -10:00
Automatic update from web-platform-tests Add WPT for referrer handling in HTTPS Upgrades This WPT test checks that HTTPS Upgrading does not drop referrer information when: 1. Referrer policy is no-referrer-when-downgrade 2. A navigation is made to an URL is HTTP 3. Navigated URL is successfully upgraded to HTTPS In this scenario, the upgraded HTTPS URL should get the referrer information since the connection was never downgraded to an unsafe URL. The current implementation of HTTPS Upgrades in Chrome doesn't pass this test, dropping the referrer. Bug: 1394910 Change-Id: I459e5fcdc97adc19dc42aa5ba1ca0b1617d2158d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5122096 Reviewed-by: Carlos IL <[email protected]> Commit-Queue: Mustafa Emre Acer <[email protected]> Cr-Commit-Position: refs/heads/main@{#1237834} -- wpt-commits: 562cd9772ab708e4ca367ea1efac4833ec1f8b1b wpt-pr: 43676
30 lines
1.1 KiB
HTML
30 lines
1.1 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>HTTPS Upgrades: Upgrade.</title>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<script src="/common/get-host-info.sub.js"></script>
|
|
|
|
<meta name="referrer" content="no-referrer-when-downgrade" />
|
|
|
|
</head>
|
|
<body>
|
|
<script>
|
|
setup({ single_test: true });
|
|
// When the referrer policy is no-referrer-when-downgrade, HTTPS upgrades should not drop
|
|
// the referrer upon navigating to an HTTP URL if the upgrade is successful.
|
|
|
|
// HTTPS upgrades don't change custom ports, so this will load correctly if an HTTPS upgrade is performed,
|
|
// and will fail to load otherwise (since the port will be wrong for http).
|
|
var url = new URL("http://{{host}}:{{ports[https][0]}}/https-upgrades/resources/pass-with-referrer.html")
|
|
window.onmessage = function(event) {
|
|
if (event.data['pass'] && event.data['referrer'] == document.location.href) {
|
|
done();
|
|
}
|
|
}
|
|
win = window.open(url)
|
|
</script>
|
|
</body>
|
|
</html>
|