Add test for issue #1188

This commit is contained in:
Vinnie Falco
2018-07-12 08:49:25 -07:00
parent e73b33f2bf
commit e8c6a82c3b
2 changed files with 24 additions and 0 deletions

View File

@ -1,3 +1,9 @@
Version 177:
* Add test for issue #1188
--------------------------------------------------------------------------------
Version 176:
* Tidy up Quick Reference

View File

@ -343,6 +343,23 @@ public:
BEAST_EXPECT(std::distance(m1.begin(), m1.end()) == 0);
}
void
testIssue1187()
{
// make sure parser finishes on redirect
error_code ec;
parser_type<false> p;
p.eager(true);
p.put(buf(
"HTTP/1.1 301 Moved Permanently\r\n"
"Location: https://www.ebay.com\r\n"
"\r\n\r\n"), ec);
BEAST_EXPECTS(! ec, ec.message());
BEAST_EXPECT(p.is_header_done());
BEAST_EXPECT(! p.is_done());
BEAST_EXPECT(p.need_eof());
}
void
run() override
{
@ -351,6 +368,7 @@ public:
testNeedMore<multi_buffer>();
testGotSome();
testIssue818();
testIssue1187();
}
};