From e8c6a82c3b3c8c656122f3ce61386f681da79bda Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Thu, 12 Jul 2018 08:49:25 -0700 Subject: [PATCH] Add test for issue #1188 --- CHANGELOG.md | 6 ++++++ test/beast/http/parser.cpp | 18 ++++++++++++++++++ 2 files changed, 24 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f8d7cbf9..e11bc197 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +Version 177: + +* Add test for issue #1188 + +-------------------------------------------------------------------------------- + Version 176: * Tidy up Quick Reference diff --git a/test/beast/http/parser.cpp b/test/beast/http/parser.cpp index 59374565..75bf9b9e 100644 --- a/test/beast/http/parser.cpp +++ b/test/beast/http/parser.cpp @@ -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 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(); testGotSome(); testIssue818(); + testIssue1187(); } };