diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 23:18:39 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-16 23:18:39 +0000 |
commit | 43d6ae71a774a5e07595047367689e27af36d9eb (patch) | |
tree | 41baa3f524aac9a3dbe25f6a14f832c0747d325f /net/http/http_response_headers.cc | |
parent | a902489dc0a391b0bfa92b8a172aa6369b568436 (diff) | |
download | chromium_src-43d6ae71a774a5e07595047367689e27af36d9eb.zip chromium_src-43d6ae71a774a5e07595047367689e27af36d9eb.tar.gz chromium_src-43d6ae71a774a5e07595047367689e27af36d9eb.tar.bz2 |
Fixing a bug in HttpResponseHeaders.GetContentRange
The code has a glitch in handling LWS near to the "bytes" token.
BUG=14216
Review URL: http://codereview.chromium.org/126229
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18556 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_response_headers.cc')
-rw-r--r-- | net/http/http_response_headers.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/net/http/http_response_headers.cc b/net/http/http_response_headers.cc index 4038aff..81d2ceb 100644 --- a/net/http/http_response_headers.cc +++ b/net/http/http_response_headers.cc @@ -1000,8 +1000,13 @@ bool HttpResponseHeaders::GetContentRange(int64* first_byte_position, return false; // Invalid header if it doesn't contain "bytes-unit". - if (!LowerCaseEqualsASCII(content_range_spec.begin(), - content_range_spec.begin() + space_position, + std::string::const_iterator content_range_spec_begin = + content_range_spec.begin(); + std::string::const_iterator content_range_spec_end = + content_range_spec.begin() + space_position; + HttpUtil::TrimLWS(&content_range_spec_begin, &content_range_spec_end); + if (!LowerCaseEqualsASCII(content_range_spec_begin, + content_range_spec_end, "bytes")) { return false; } |