Commit 8176fd9d authored by Min Qin's avatar Min Qin Committed by Commit Bot

Network Service: Set the initiator before starting URLRequest

The initiator is used for checking cookies.
And it is mising from the URLRequest when URLLoader is used.
For example, DownloadContentTest.DownloadAttributeSameOriginRedirect will redirect
a link click to a download with a different origin.
Download should pass the initiator in the URLRequest,
but missing it causes the wrong cookie to be passed.
This CL sets the intiator in the URLRequest so the above test can partially work.

BUG=786598

Cq-Include-Trybots: master.tryserver.chromium.linux:linux_mojo
Change-Id: I4efffd41fc9ca26063d853ce03e7c7ff817a917c
Reviewed-on: https://chromium-review.googlesource.com/777552Reviewed-by: default avatarJohn Abd-El-Malek <jam@chromium.org>
Commit-Queue: John Abd-El-Malek <jam@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517864}
parent 1d39d465
...@@ -332,6 +332,8 @@ URLLoader::URLLoader(NetworkContext* context, ...@@ -332,6 +332,8 @@ URLLoader::URLLoader(NetworkContext* context,
} }
} }
url_request_->set_initiator(request.request_initiator);
int load_flags = BuildLoadFlagsForRequest(request, false); int load_flags = BuildLoadFlagsForRequest(request, false);
url_request_->SetLoadFlags(load_flags); url_request_->SetLoadFlags(load_flags);
if (report_raw_headers_) { if (report_raw_headers_) {
......
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