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

Unified Diff: net/spdy/spdy_session.cc

Issue 1604011: Use HttpRequestHeaders for extra_headers. (Closed)
Patch Set: Address eroman comments. Created 10 years, 8 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 | « net/spdy/spdy_session.h ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/spdy/spdy_session.cc
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 2607f9066f10ae774c5b3c674e83b910b851a965..29b96108a0ec037d46780cbe8e91f14f59861057 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -132,19 +132,21 @@ bool SpdyHeadersToHttpResponse(const spdy::SpdyHeaderBlock& headers,
// a HttpRequestInfo block.
void CreateSpdyHeadersFromHttpRequest(
const HttpRequestInfo& info, spdy::SpdyHeaderBlock* headers) {
+ // TODO(willchan): It's not really necessary to convert from
+ // HttpRequestHeaders to spdy::SpdyHeaderBlock.
+
static const char kHttpProtocolVersion[] = "HTTP/1.1";
- HttpUtil::HeadersIterator it(info.extra_headers.begin(),
- info.extra_headers.end(),
- "\r\n");
+ HttpRequestHeaders::Iterator it(info.extra_headers);
+
while (it.GetNext()) {
std::string name = StringToLowerASCII(it.name());
if (headers->find(name) == headers->end()) {
- (*headers)[name] = it.values();
+ (*headers)[name] = it.value();
} else {
std::string new_value = (*headers)[name];
new_value.append(1, '\0'); // +=() doesn't append 0's
- new_value += it.values();
+ new_value += it.value();
(*headers)[name] = new_value;
}
}
@@ -155,8 +157,6 @@ void CreateSpdyHeadersFromHttpRequest(
(*headers)["method"] = info.method;
(*headers)["url"] = info.url.spec();
(*headers)["version"] = kHttpProtocolVersion;
- if (info.user_agent.length())
- (*headers)["user-agent"] = info.user_agent;
if (!info.referrer.is_empty())
(*headers)["referer"] = info.referrer.spec();
« no previous file with comments | « net/spdy/spdy_session.h ('k') | net/url_request/url_request_http_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698