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
2017-07-20 08:12:12 -07:00
committed by Vinnie Falco
parent 843d7a5a9c
commit bc665ee1ec
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());
}
}
};