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

Unified Diff: net/http/http_response_headers_unittest.cc

Issue 10809011: Fix removal of headers (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
« net/http/http_response_headers.cc ('K') | « net/http/http_response_headers.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_response_headers_unittest.cc
diff --git a/net/http/http_response_headers_unittest.cc b/net/http/http_response_headers_unittest.cc
index 00608e25f0df1ae13991ba23fa9d09d44ef0ba6b..3c8d9362ec711988f34996274181d30e67279a8b 100644
--- a/net/http/http_response_headers_unittest.cc
+++ b/net/http/http_response_headers_unittest.cc
@@ -1642,7 +1642,7 @@ TEST(HttpResponseHeadersTest, RemoveIndividualHeader) {
const struct {
const char* orig_headers;
const char* to_remove_name;
- const char* to_remove_value;
+ const char* to_remove_values;
rvargas (doing something else) 2012/07/19 19:11:02 nit: I would still use singular here.
battre 2012/07/23 13:31:11 Done.
const char* expected_headers;
} tests[] = {
{ "HTTP/1.1 200 OK\n"
@@ -1685,7 +1685,33 @@ TEST(HttpResponseHeadersTest, RemoveIndividualHeader) {
"Content-Length: 450\n"
"Cache-control: max-age=10000\n"
},
+ { "HTTP/1.1 200 OK\n"
+ "connection: keep-alive \n"
+ "Foo: bar, baz\n"
rvargas (doing something else) 2012/07/19 19:11:02 How about adding another "Foo: bar\n" line here (t
battre 2012/07/23 13:31:11 Done.
+ "Cache-control: max-age=10000\n",
+
+ "Foo",
+
+ "bar, baz", // Space in value.
+ "HTTP/1.1 200 OK\n"
+ "connection: keep-alive\n"
+ "Cache-control: max-age=10000\n"
+ },
+ { "HTTP/1.1 200 OK\n"
+ "connection: keep-alive \n"
+ "Foo: bar, baz\n"
+ "Cache-control: max-age=10000\n",
+
+ "Foo",
+
+ "baz", // Only partial match -> ignored.
+
+ "HTTP/1.1 200 OK\n"
+ "connection: keep-alive\n"
+ "Foo: bar, baz\n"
+ "Cache-control: max-age=10000\n"
+ },
};
for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
@@ -1695,8 +1721,8 @@ TEST(HttpResponseHeadersTest, RemoveIndividualHeader) {
new net::HttpResponseHeaders(orig_headers));
std::string name(tests[i].to_remove_name);
- std::string value(tests[i].to_remove_value);
- parsed->RemoveHeaderWithValue(name, value);
+ std::string values(tests[i].to_remove_values);
+ parsed->RemoveHeaderLine(name, values);
std::string resulting_headers;
parsed->GetNormalizedHeaders(&resulting_headers);
« net/http/http_response_headers.cc ('K') | « net/http/http_response_headers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698