Remove redundant instation of static_string in websocket

Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
This commit is contained in:
Damian Jarek
2019-06-08 16:21:46 +02:00
parent d5f5f1467f
commit a7ff1a41e7
2 changed files with 4 additions and 3 deletions

View File

@ -4,6 +4,7 @@ Version 259:
* Remove the use of `static_string` from `http::fields`
* Add gcc-9 to AzP CI test matrix
* Enable split compilation in http::basic_fields
* Remove redundant instation of `static_string` in websocket
--------------------------------------------------------------------------------

View File

@ -47,11 +47,11 @@ make_sec_ws_accept(
string_view key)
{
BOOST_ASSERT(key.size() <= sec_ws_key_type::max_size_n);
static_string<sec_ws_key_type::max_size_n + 36> m(key);
m.append("258EAFA5-E914-47DA-95CA-C5AB0DC85B11");
auto const& guid = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11";
beast::detail::sha1_context ctx;
beast::detail::init(ctx);
beast::detail::update(ctx, m.data(), m.size());
beast::detail::update(ctx, key.data(), key.size());
beast::detail::update(ctx, guid, sizeof(guid) - 1);
char digest[beast::detail::sha1_context::digest_size];
beast::detail::finish(ctx, &digest[0]);
accept.resize(accept.max_size());