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

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: Nit 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
« no previous file with comments | « 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..981fa107857790e3f47a81cb689e39600bff0308 100644
--- a/net/http/http_response_headers_unittest.cc
+++ b/net/http/http_response_headers_unittest.cc
@@ -1685,7 +1685,35 @@ 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"
+ "Foo: bar\n"
+ "Cache-control: max-age=10000\n",
+
+ "Foo",
+
+ "bar, baz", // Space in value.
+ "HTTP/1.1 200 OK\n"
+ "connection: keep-alive\n"
+ "Foo: bar\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) {
@@ -1696,7 +1724,7 @@ TEST(HttpResponseHeadersTest, RemoveIndividualHeader) {
std::string name(tests[i].to_remove_name);
std::string value(tests[i].to_remove_value);
- parsed->RemoveHeaderWithValue(name, value);
+ parsed->RemoveHeaderLine(name, value);
std::string resulting_headers;
parsed->GetNormalizedHeaders(&resulting_headers);
« no previous file with comments | « net/http/http_response_headers.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698