Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(266)

Issue 2450343002: Apply document's referrer policy on client-initiated reload (Closed)

Created:
4 years, 1 month ago by estark
Modified:
4 years, 1 month ago
Reviewers:
CC:
chromium-reviews
Target Ref:
refs/pending/branch-heads/2901
Project:
chromium
Visibility:
Public.

Description

Apply 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+40 lines, -2 lines) Patch
A third_party/WebKit/LayoutTests/http/tests/security/referrer-on-client-reload.html View 1 chunk +23 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/http/tests/security/resources/post-referrer-on-reload.html View 1 chunk +14 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/loader/FrameLoader.cpp View 1 chunk +3 lines, -2 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
estark
4 years, 1 month ago (2016-10-26 22:38:14 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
1c8610f6fa44528bbe66c6d18f9ef5544b7ca7f8.

Powered by Google App Engine
This is Rietveld 408576698