Remove redundant use of static_string

This avoids an instantiation and copy of the data when adding the Server
header field.

Close #1613

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
Damian Jarek committed 2019-05-19 22:32:43 +02:00
1 parent cefb744794
commit dcf3db7f83
2 files changed
+3 -7

No files matched your search

@@ -80,13 +80,8 @@ build_response(
decorator_opt(res);
decorator(res);
if(! res.count(http::field::server))
{
// VFALCO this is weird..
BOOST_STATIC_ASSERT(sizeof(
BOOST_BEAST_VERSION_STRING) < 20);
static_string<20> s(BOOST_BEAST_VERSION_STRING);
res.set(http::field::server, s);
}
res.set(http::field::server,
string_view(BOOST_BEAST_VERSION_STRING));
};
auto err =
[&](error e)