basic_parser: apply header_limit_ to trailer headers

This commit is contained in:
Mohammad Nejati
2024-08-22 00:22:16 +03:30
committed by Mohammad Nejati
parent f181fbf6e4
commit a620d4175a
6 changed files with 86 additions and 138 deletions
+20
View File
@@ -859,6 +859,26 @@ public:
BEAST_EXPECT(! p.is_done());
BEAST_EXPECTS(ec == error::header_limit, ec.message());
}
{
multi_buffer b;
ostream(b) <<
"POST / HTTP/1.1\r\n"
"Transfer-Encoding: chunked\r\n"
"\r\n"
"0\r\n";
error_code ec;
test_parser<true> p;
p.header_limit(47);
p.eager(true);
b.consume(p.put(b.data(), ec));
BEAST_EXPECTS(ec == error::need_more, ec.message());
ostream(b) <<
"field: value\r\n"
"\r\n";
b.consume(p.put(b.data(), ec));
BEAST_EXPECT(! p.is_done());
BEAST_EXPECTS(ec == error::header_limit, ec.message());
}
{
multi_buffer b;
ostream(b) <<