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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 2429623002: LoadURLParams::extra_headers should not apply to subresource requests. (Closed)
Patch Set: Added a comment explaining why extra_headers should only apply to navigations. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index d8b476c7b68335ca052cf30cd89d9c7515418c92..5d976e60c6258f12e0f6fb6ad4b53a5c27e657ee 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -4219,6 +4219,8 @@ void RenderFrameImpl::willSendRequest(blink::WebLocalFrame* frame,
navigation_state->common_params().allow_download);
extra_data->set_transition_type(transition_type);
extra_data->set_should_replace_current_entry(should_replace_current_entry);
+ // TODO(lukasza): https://crbug.com/656179: Navigational things (e.g.
+ // StartNavigationParams) should not apply to subresource requests.
extra_data->set_transferred_request_child_id(
navigation_state->start_params().transferred_request_child_id);
extra_data->set_transferred_request_request_id(
@@ -4253,7 +4255,12 @@ void RenderFrameImpl::willSendRequest(blink::WebLocalFrame* frame,
request.setRequestorID(render_view_->GetRoutingID());
request.setHasUserGesture(WebUserGestureIndicator::isProcessingUserGesture());
- if (!navigation_state->start_params().extra_headers.empty()) {
+ // StartNavigationParams should only apply to navigational requests (and not
+ // to subresource requests). For example - Content-Type header provided via
+ // OpenURLParams::extra_headers should only be applied to the original POST
+ // navigation request (and not to subresource requests).
+ if (!navigation_state->start_params().extra_headers.empty() &&
+ request.getFrameType() != WebURLRequest::FrameTypeNone) {
for (net::HttpUtil::HeadersIterator i(
navigation_state->start_params().extra_headers.begin(),
navigation_state->start_params().extra_headers.end(), "\n");
« no previous file with comments | « content/browser/frame_host/navigation_controller_impl_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698