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

Unified Diff: tests/standalone/src/io/HttpParserTest.dart

Issue 10033023: Fix bug in HTTP header parsing (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 8 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 | « runtime/bin/http_parser.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/standalone/src/io/HttpParserTest.dart
diff --git a/tests/standalone/src/io/HttpParserTest.dart b/tests/standalone/src/io/HttpParserTest.dart
index c20c59616c64e9c330f89825032a1a1018108046..0e8275387051006f9b1e2b5df662702214a6854f 100644
--- a/tests/standalone/src/io/HttpParserTest.dart
+++ b/tests/standalone/src/io/HttpParserTest.dart
@@ -300,6 +300,18 @@ X-Header-B: bbb\r
request = """
POST /test HTTP/1.1\r
+Empty-Header-1:\r
+Empty-Header-2:\r
+ \r
+\r
+""";
+ headers = new Map();
+ headers["empty-header-1"] = "";
+ headers["empty-header-2"] = "";
+ _testParseRequest(request, "POST", "/test", expectedHeaders: headers);
+
+ request = """
+POST /test HTTP/1.1\r
Header-A: AAA\r
X-Header-B:\t \t bbb\r
\r
@@ -570,15 +582,12 @@ HTTP/1.1 200 OK\r
request = "GET / HTTP/1.\r\n\r\n";
_testParseInvalidRequest(request);
+ request = "GET / HTTP/1.1\r\nKeep-Alive: False\r\nbadheader\r\n\r\n";
+ _testParseInvalidRequest(request);
+
// Currently no HTTP 1.0 support.
request = "GET / HTTP/1.0\r\n\r\n";
_testParseInvalidRequest(request);
-
- Expect.throws(() {
- // TODO(2370): HTTP parser error.
- request = "GET / HTTP/1.1\r\nKeep-Alive: False\r\nbadheader\r\n\r\n";
- _testParseInvalidRequest(request);
- });
}
static void testParseInvalidResponse() {
@@ -617,6 +626,9 @@ HTTP/1.1 200 OK\r
response = "HTTP/1.1 200 OK\r\nContent-Length: x\r\n\r\n";
_testParseInvalidResponse(response);
+ response = "HTTP/1.1 200 OK\r\nbadheader\r\n\r\n";
+ _testParseInvalidResponse(response);
+
response = """
HTTP/1.1 200 OK\r
Transfer-Encoding: chunked\r
« no previous file with comments | « runtime/bin/http_parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698