diff options
author | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-26 21:34:08 +0000 |
---|---|---|
committer | hclam@chromium.org <hclam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-26 21:34:08 +0000 |
commit | 803c73a9ad3151139f85732dfad0a3b1bf9887c4 (patch) | |
tree | 51e4b08443681de6b389c2b90240bc254c7fdaf9 /net/http/http_response_headers_unittest.cc | |
parent | e0b80b3250092090db5d049c991c07a251d858f4 (diff) | |
download | chromium_src-803c73a9ad3151139f85732dfad0a3b1bf9887c4.zip chromium_src-803c73a9ad3151139f85732dfad0a3b1bf9887c4.tar.gz chromium_src-803c73a9ad3151139f85732dfad0a3b1bf9887c4.tar.bz2 |
HttpResponseHeaders::GetContentRange() to handle implied LWS
There was a bug in HttpResponseHeaders::GetContentRange() that
it didn't respect implied LWS rule, i.e. there can be arbitrary
number of spaces in the header value between tokens.
TEST=HttpResponseHeaders.GetContentRange
Review URL: http://codereview.chromium.org/113675
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16921 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/http/http_response_headers_unittest.cc')
-rw-r--r-- | net/http/http_response_headers_unittest.cc | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/net/http/http_response_headers_unittest.cc b/net/http/http_response_headers_unittest.cc index 24ca9869..c78c597 100644 --- a/net/http/http_response_headers_unittest.cc +++ b/net/http/http_response_headers_unittest.cc @@ -1109,6 +1109,13 @@ TEST(HttpResponseHeaders, GetContentRange) { 51 }, { "HTTP/1.1 206 Partial Content\n" + "Content-Range: bytes\t0-50/51", + false, + -1, + -1, + -1 + }, + { "HTTP/1.1 206 Partial Content\n" "Content-Range: bytes 0-50/51", true, 0, @@ -1116,7 +1123,22 @@ TEST(HttpResponseHeaders, GetContentRange) { 51 }, { "HTTP/1.1 206 Partial Content\n" - "Content-Range: bytes 0 - 50 / 51", + "Content-Range: bytes 0 - 50 \t / \t51", + true, + 0, + 50, + 51 + }, + { "HTTP/1.1 206 Partial Content\n" + "Content-Range: bytes 0\t-\t50\t/\t51\t", + true, + 0, + 50, + 51 + }, + + { "HTTP/1.1 206 Partial Content\n" + "Content-Range: \t bytes \t 0 - 50 / 5 1", false, -1, -1, @@ -1136,6 +1158,13 @@ TEST(HttpResponseHeaders, GetContentRange) { -1, -1 }, + { "HTTP/1.1 416 Requested range not satisfiable\n" + "Content-Range: bytes * / * ", + true, + -1, + -1, + -1 + }, { "HTTP/1.1 206 Partial Content\n" "Content-Range: bytes 0-50/*", true, @@ -1144,6 +1173,13 @@ TEST(HttpResponseHeaders, GetContentRange) { -1 }, { "HTTP/1.1 206 Partial Content\n" + "Content-Range: bytes 0-50 / * ", + true, + 0, + 50, + -1 + }, + { "HTTP/1.1 206 Partial Content\n" "Content-Range: bytes 0-10000000000/10000000001", true, 0, |