From 4928c2cca393b8f8e917d99aba901a2c3f144afb Mon Sep 17 00:00:00 2001 From: qicosmos Date: Tue, 16 Jan 2024 12:58:09 +0800 Subject: [PATCH] fix ws (#492) --- include/cinatra/coro_http_connection.hpp | 2 +- include/cinatra/utils.hpp | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/cinatra/coro_http_connection.hpp b/include/cinatra/coro_http_connection.hpp index 1ba03480..c8e575d4 100644 --- a/include/cinatra/coro_http_connection.hpp +++ b/include/cinatra/coro_http_connection.hpp @@ -724,7 +724,7 @@ class coro_http_connection code_utils::base64_encode(accept_key, sha1buf, sizeof(sha1buf), 0); - response_.set_status(status_type::switching_protocols); + response_.set_status_and_content(status_type::switching_protocols); response_.add_header("Upgrade", "WebSocket"); response_.add_header("Connection", "Upgrade"); diff --git a/include/cinatra/utils.hpp b/include/cinatra/utils.hpp index 277a7d62..8e7bdd83 100644 --- a/include/cinatra/utils.hpp +++ b/include/cinatra/utils.hpp @@ -10,6 +10,7 @@ #include #include #include +#include #include //std::byte #include #include