Chromium Code Reviews
DescriptionApply document's referrer policy on client-initiated reload
location.reload() has apparently never applied the document's referrer
policy to the reload request.
Before https://codereview.chromium.org/2393633006, this was never
noticed, because the net stack's information about referrer policies was
too coarse to trigger its sanity check that the referrer matches the
referrer policy. So the request would go through fine, but with the
wrong referrer (e.g. a referrer of http://example.com/foo even if the
document's referrer policy was 'origin').
But https://codereview.chromium.org/2393633006 gave the net stack
finer-grained information about referrer policies, so that the sanity
check does catch reload requests where the referrer does not match the
referrer policy. On a DCHECK build, location.reload() on a page with a
referrer policy of, e.g., 'origin' hits a NOTREACHED(). On a non-DCHECK
build, location.reload() flashes a net error page because the request
gets cancelled.
This CL fixes this by using SecurityPolicy::generateReferrer() to set
the referrer on the reload request.
BUG=658707
Review-Url: https://codereview.chromium.org/2450533002
Cr-Commit-Position: refs/heads/master@{#427712}
(cherry picked from commit 1dad47f20ed56478257aad69c35141472cff4c18)
Committed: https://chromium.googlesource.com/chromium/src/+/1c8610f6fa44528bbe66c6d18f9ef5544b7ca7f8
Patch Set 1 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||||||||||||||||||||