Index: net/http/http_response_headers_unittest.cc |
=================================================================== |
--- net/http/http_response_headers_unittest.cc (revision 1706) |
+++ net/http/http_response_headers_unittest.cc (working copy) |
@@ -68,7 +68,7 @@ |
TEST(HttpResponseHeadersTest, NormalizeHeadersWhitespace) { |
TestData test = { |
"HTTP/1.1 202 Accepted \n" |
- " Content-TYPE : text/html; charset=utf-8 \n" |
+ "Content-TYPE : text/html; charset=utf-8 \n" |
"Set-Cookie: a \n" |
"Set-Cookie: b \n", |
@@ -81,6 +81,24 @@ |
TestCommon(test); |
} |
+// Check that we normalize headers properly (header name is invalid if starts |
+// with LWS). |
+TEST(HttpResponseHeadersTest, NormalizeHeadersLeadingWhitespace) { |
+ TestData test = { |
+ "HTTP/1.1 202 Accepted \n" |
+ // Starts with space -- will be skipped as invalid. |
+ " Content-TYPE : text/html; charset=utf-8 \n" |
+ "Set-Cookie: a \n" |
+ "Set-Cookie: b \n", |
+ |
+ "HTTP/1.1 202 Accepted\n" |
+ "Set-Cookie: a, b\n", |
+ |
+ 202 |
+ }; |
+ TestCommon(test); |
+} |
+ |
TEST(HttpResponseHeadersTest, BlankHeaders) { |
TestData test = { |
"HTTP/1.1 200 OK\n" |