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

Issue 2230103003: Propagate Origin header via CreateURLRequestForNavigation. (Closed)

Created:
4 years, 4 months ago by Łukasz Anforowicz
Modified:
4 years, 4 months ago
Reviewers:
jww, Avi (use Gerrit)
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, creis+watch_chromium.org, nasko+codewatch_chromium.org, jam, darin-cc_chromium.org, blink-reviews, site-isolation-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Propagate Origin header via CreateURLRequestForNavigation. The CL makes sure that when CreateURLRequestForNavigation populates Referrer of WebURLRequest, it also adds Origin header if needed, by calling WebURLRequest::addHTTPOriginIfNeeded with Origin derrived from Referrer. Because ResourceRequest::addHTTPOriginIfNeeded method inspects the HTTP method, the call to WebURLRequest::setHTTPMethod had to be moved slightly earlier. The modified CreateURLRequestForNavigation helper function is called from 1) RenderFrameImpl::NavigateInternal and 2) RenderFrameImpl::OnFailedNavigation (PlzNavigate-only, returned WebURLRequest is only used in a call to GetNavigationErrorStrings) The CL also adds 2 extra tests to ensure that not only the CL fixes form-targets-cross-site-frame-post.html scenario, but that Origin and Referer headers are also behaving expectedly if 1) referrer policy is present or 2) redirects are present. BUG=635400 CQ_INCLUDE_TRYBOTS=master.tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/693329deb699ad58094fa7ef4d75087aa2411c2b Cr-Commit-Position: refs/heads/master@{#411841}

Patch Set 1 #

Patch Set 2 : Tests for referrer policy. #

Patch Set 3 : Browser test for verifying Origin and Referer headers after POST + redirects. #

Patch Set 4 : Rebasing... #

Total comments: 2

Patch Set 5 : Simplify code for converting GURL into WebString representing the origin. #

Total comments: 3

Messages

Total messages: 16 (7 generated)
Łukasz Anforowicz
jww@, can you take a look please? The tests are passing (including tests for referrer ...
4 years, 4 months ago (2016-08-12 15:59:09 UTC) #4
jww
This lgtm with one nit. Thanks for the work on all of this! https://codereview.chromium.org/2230103003/diff/60001/content/renderer/render_frame_impl.cc File ...
4 years, 4 months ago (2016-08-12 21:10:54 UTC) #5
Łukasz Anforowicz
Thanks. avi@, could you please do an OWNERS review for //content? https://codereview.chromium.org/2230103003/diff/60001/content/renderer/render_frame_impl.cc File content/renderer/render_frame_impl.cc (right): ...
4 years, 4 months ago (2016-08-12 22:09:43 UTC) #6
Łukasz Anforowicz
Actually adding avi@ this time around... :-)
4 years, 4 months ago (2016-08-12 22:10:22 UTC) #8
Avi (use Gerrit)
lgtm https://codereview.chromium.org/2230103003/diff/80001/content/test/data/form_that_posts_cross_site.html File content/test/data/form_that_posts_cross_site.html (right): https://codereview.chromium.org/2230103003/diff/80001/content/test/data/form_that_posts_cross_site.html#newcode5 content/test/data/form_that_posts_cross_site.html:5: <form id="text-form" method="POST" action="/cross-site-307/i.com/cross-site-307/x.com/echoall"> This change doesn't interfere ...
4 years, 4 months ago (2016-08-12 22:54:33 UTC) #9
Łukasz Anforowicz
Thanks! https://codereview.chromium.org/2230103003/diff/80001/content/test/data/form_that_posts_cross_site.html File content/test/data/form_that_posts_cross_site.html (right): https://codereview.chromium.org/2230103003/diff/80001/content/test/data/form_that_posts_cross_site.html#newcode5 content/test/data/form_that_posts_cross_site.html:5: <form id="text-form" method="POST" action="/cross-site-307/i.com/cross-site-307/x.com/echoall"> On 2016/08/12 22:54:33, Avi ...
4 years, 4 months ago (2016-08-12 23:00:30 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2230103003/80001
4 years, 4 months ago (2016-08-12 23:01:14 UTC) #13
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 4 months ago (2016-08-13 01:10:59 UTC) #14
commit-bot: I haz the power
4 years, 4 months ago (2016-08-13 01:13:07 UTC) #16
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/693329deb699ad58094fa7ef4d75087aa2411c2b
Cr-Commit-Position: refs/heads/master@{#411841}

Powered by Google App Engine
This is Rietveld 408576698