diff options
author | xunjieli <xunjieli@chromium.org> | 2015-12-02 05:24:16 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-02 13:25:03 +0000 |
commit | 0187bedbd1df7a389d7551965ea4887a9e349fbd (patch) | |
tree | c38a04b34ba160d5f5aa82f33aa49d5c262335a4 /net/spdy/spdy_http_utils.cc | |
parent | 650c6b0cd1511e21655f0a4c8d6513a7d1a9e3aa (diff) | |
download | chromium_src-0187bedbd1df7a389d7551965ea4887a9e349fbd.zip chromium_src-0187bedbd1df7a389d7551965ea4887a9e349fbd.tar.gz chromium_src-0187bedbd1df7a389d7551965ea4887a9e349fbd.tar.bz2 |
Change CreateSpdyHeadersFromHttpResponse to strip HTTP status text
HTTP status text should not be included when building H2
response headers from HttpResponseHeaders.
HttpResponseHeaders automatically add a "OK" even when
status text is unspecified, but H2 response :status should
be pure integer.
BUG=564023
Review URL: https://codereview.chromium.org/1485293002
Cr-Commit-Position: refs/heads/master@{#362691}
Diffstat (limited to 'net/spdy/spdy_http_utils.cc')
-rw-r--r-- | net/spdy/spdy_http_utils.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/net/spdy/spdy_http_utils.cc b/net/spdy/spdy_http_utils.cc index 7162d96..af55ac4 100644 --- a/net/spdy/spdy_http_utils.cc +++ b/net/spdy/spdy_http_utils.cc @@ -171,7 +171,11 @@ void CreateSpdyHeadersFromHttpResponse( if (protocol_version < HTTP2) { (*headers)[version_key] = std::string(status_line.begin(), after_version); } - (*headers)[status_key] = std::string(after_version + 1, status_line.end()); + + // Get status code only. + std::string::const_iterator after_status = + std::find(after_version + 1, status_line.end(), ' '); + (*headers)[status_key] = std::string(after_version + 1, after_status); void* iter = NULL; std::string raw_name, value; |