summaryrefslogtreecommitdiffstats
path: root/net/spdy/spdy_session.cc
diff options
context:
space:
mode:
authorwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 22:15:43 +0000
committerwillchan@chromium.org <willchan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-20 22:15:43 +0000
commit8c76ae2ff868d7968c850f06822e2f8353bd87e1 (patch)
tree0051ecbee24c9b48fc46ae914aedd8b7a1ab0c25 /net/spdy/spdy_session.cc
parent1e507001a1f4b7e9f96ad4faffd0448a586ac304 (diff)
downloadchromium_src-8c76ae2ff868d7968c850f06822e2f8353bd87e1.zip
chromium_src-8c76ae2ff868d7968c850f06822e2f8353bd87e1.tar.gz
chromium_src-8c76ae2ff868d7968c850f06822e2f8353bd87e1.tar.bz2
Use HttpRequestHeaders for extra_headers.
BUG=22588 Review URL: http://codereview.chromium.org/1604011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/spdy/spdy_session.cc')
-rw-r--r--net/spdy/spdy_session.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/net/spdy/spdy_session.cc b/net/spdy/spdy_session.cc
index 54e80c9..90b040c 100644
--- a/net/spdy/spdy_session.cc
+++ b/net/spdy/spdy_session.cc
@@ -133,19 +133,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;
}
}
@@ -156,8 +158,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();