Fix handling empty HTTP headers in parser_v1.hpp

This patch rectifies flush() of beast::http::parser_v1
to properly handle the case when an HTTP header has
empty value.

Without the fix an empty-valued HTTP header is being
concatenated with the header directly following it.
This situation can be replicated using eg. curl:

  curl <url> -H "X-First;" -H "X-Second: bla"

What Beast's client would see is a single header named
as "X-FirstX-Second".
This commit is contained in:
Radoslaw Zarzynski
2016-10-08 01:30:10 -04:00
committed by Vinnie Falco
parent c39cc068ff
commit c54762ae1a
3 changed files with 12 additions and 7 deletions
+1 -1
View File
@@ -263,7 +263,7 @@ public:
}
catch(system_error const& se)
{
BEAST_EXPECT(se.code() == ev);
BEAST_EXPECTS(se.code() == ev, se.what());
}
}
};