Commit c6df4d27 authored by Fabrice de Gans-Riberi's avatar Fabrice de Gans-Riberi Committed by Commit Bot

[Fuchsia] Implement extra headers support in NavigationController.

This implements setting and using the |headers| data in
LoadUrlParams. A new test fixture is added to ensure the extra headers
are properly received by the test server.

Bug: 923598
Change-Id: I59a44c886f1853bbc631ae016b0655dd1d4d539b
Reviewed-on: https://chromium-review.googlesource.com/c/1427565
Commit-Queue: Fabrice de Gans-Riberi <fdegans@chromium.org>
Reviewed-by: default avatarKevin Marshall <kmarshall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#625912}
parent 06614ee8
......@@ -295,6 +295,16 @@ void FrameImpl::LoadUrl(std::string url,
content::NavigationController::LoadURLParams params_converted(validated_url);
if (!params->headers.empty()) {
std::vector<base::StringPiece> extra_headers;
extra_headers.reserve(params->headers.size());
for (const auto& header : params->headers) {
extra_headers.push_back(base::StringPiece(
reinterpret_cast<const char*>(header.data()), header.size()));
}
params_converted.extra_headers = base::JoinString(extra_headers, "\n");
}
if (validated_url.scheme() == url::kDataScheme)
params_converted.load_type = content::NavigationController::LOAD_TYPE_DATA;
......
This diff is collapsed.
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