Fix Content-Length parsing

Fix #1880
This commit is contained in:
Richard Hodges
2020-03-19 16:21:29 +01:00
parent 5e9e517dc5
commit d12dcef52c
6 changed files with 113 additions and 20 deletions
+4 -2
View File
@@ -692,6 +692,8 @@ public:
parsegrind<P>(m("Content-LengtX: 0\r\n"), expect_flags{*this, 0});
parsegrind<P>(m("Content-Lengths: many\r\n"), expect_flags{*this, 0});
parsegrind<P>(m("Content: full\r\n"), expect_flags{*this, 0});
parsegrind<P>(m("Content-Length: 0\r\n"
"Content-Length: 0\r\n"), expect_flags{*this, 0});
failgrind<P>(c("\r\n"), error::bad_content_length);
failgrind<P>(c("18446744073709551616\r\n"), error::bad_content_length);
@@ -699,8 +701,8 @@ public:
failgrind<P>(c("0 1\r\n"), error::bad_content_length);
failgrind<P>(c(",\r\n"), error::bad_content_length);
failgrind<P>(c("0,\r\n"), error::bad_content_length);
failgrind<P>(m(
"Content-Length: 0\r\nContent-Length: 0\r\n"), error::bad_content_length);
failgrind<P>(m("Content-Length: 0\r\n"
"Content-Length: 100\r\n"), error::bad_content_length);
}
void