Commit 97c5b52f authored by Antonio Sartori's avatar Antonio Sartori Committed by Commit Bot

Fix WPT for Referrer Policy about:blank inheritance

When Referrer-Policy is `origin`, we should expect the URL in the
Referer header to be document's origin with a trailing '/', see
https://w3c.github.io/webappsec-referrer-policy/#referrer-policy-origin

Change-Id: I720dbf0892701b380aebab8d7b8c4aa55098c88c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2438423Reviewed-by: default avatarArthur Sonzogni <arthursonzogni@chromium.org>
Commit-Queue: Antonio Sartori <antoniosartori@chromium.org>
Cr-Commit-Position: refs/heads/master@{#812621}
parent 50ca45ad
This is a testharness.js-based test.
PASS The fetch() API in an about:blank iframe with the 'client' referrer is fetched with no 'Referer' header
FAIL The fetch() API in an about:blank iframe with a custom URL referrer is fetched with a 'Referer` header that uses the outer document's URL along with its referrer policy assert_equals: expected "http://web-platform.test:8001" but got "http://web-platform.test:8001/referrer-policy/generic/inheritance/iframe-inheritance-about-blank.html/custom"
FAIL The fetch() API in an about:blank iframe with a custom URL referrer is fetched with a 'Referer` header that uses the outer document's URL along with its referrer policy assert_equals: expected "http://web-platform.test:8001/" but got "http://web-platform.test:8001/referrer-policy/generic/inheritance/iframe-inheritance-about-blank.html/custom"
FAIL The value of document.referrer in an about:blank iframe is the outer document's full URL, regardless of referrer policy assert_equals: expected "http://web-platform.test:8001/referrer-policy/generic/inheritance/iframe-inheritance-about-blank.html" but got "http://web-platform.test:8001/"
PASS A subresource fetched from an about:blank iframe is fetched with no 'Referer' header
Harness: the test ran to completion.
......
......@@ -42,7 +42,7 @@ window.addEventListener("message", msg => {
// inherits its parent's referrer policy, the URL should be restricted to
// its origin.
testFetchURLReferrer.step_func_done(() => {
assert_equals(referrer, location.origin);
assert_equals(referrer, location.origin + '/');
})();
} else if (test_name === "testDocumentReferrer") {
// The referrer of the initial document in an about:blank iframe is set to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment