Fix parsing chunk size with leading zeroes

fix #496
This commit is contained in:
Vinnie Falco
2017-07-20 08:15:26 -07:00
parent 5808fa247b
commit dba4be01ab
3 changed files with 21 additions and 1 deletions
+19
View File
@@ -1054,6 +1054,24 @@ public:
});
}
// https://github.com/vinniefalco/Beast/issues/496
void
testIssue496()
{
// The bug affected hex parsing with leading zeroes
bufgrind<test_parser<false>>(
"HTTP/1.1 200 OK\r\n"
"Transfer-Encoding: chunked\r\n"
"Content-Type: application/octet-stream\r\n"
"\r\n"
"0004\r\nabcd\r\n"
"0\r\n\r\n"
,[&](test_parser<false> const& p)
{
BEAST_EXPECT(p.body == "abcd");
});
}
//--------------------------------------------------------------------------
void
@@ -1072,6 +1090,7 @@ public:
testSplit();
testIssue430();
testIssue452();
testIssue496();
testBufGrind();
}
};