From 99c2d69dc85dfcd044e4a83d4894aa52eedfe09d Mon Sep 17 00:00:00 2001 From: "Alexander A. Klimov" Date: Wed, 4 Jan 2023 17:34:49 +0100 Subject: [PATCH] Handle boost::beast::http::basic_fields#operator[]() signature change (v1.81) Use always working std::string(x), not broken x.to_string(). (x is a return value.) --- lib/remote/httphandler.cpp | 2 +- lib/remote/httpserverconnection.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/remote/httphandler.cpp b/lib/remote/httphandler.cpp index e1bb4f401..afe510fb8 100644 --- a/lib/remote/httphandler.cpp +++ b/lib/remote/httphandler.cpp @@ -58,7 +58,7 @@ void HttpHandler::ProcessRequest( Dictionary::Ptr node = m_UrlTree; std::vector handlers; - Url::Ptr url = new Url(request.target().to_string()); + Url::Ptr url = new Url(std::string(request.target())); auto& path (url->GetPath()); for (std::vector::size_type i = 0; i <= path.size(); i++) { diff --git a/lib/remote/httpserverconnection.cpp b/lib/remote/httpserverconnection.cpp index cb07557af..c07c19a38 100644 --- a/lib/remote/httpserverconnection.cpp +++ b/lib/remote/httpserverconnection.cpp @@ -246,7 +246,7 @@ bool HandleAccessControl( if (!allowedOrigins.empty()) { auto& origin (request[http::field::origin]); - if (allowedOrigins.find(origin.to_string()) != allowedOrigins.end()) { + if (allowedOrigins.find(std::string(origin)) != allowedOrigins.end()) { response.set(http::field::access_control_allow_origin, origin); } @@ -536,7 +536,7 @@ void HttpServerConnection::ProcessMessages(boost::asio::yield_context yc) if (!authenticatedUser) { CpuBoundWork fetchingAuthenticatedUser (yc); - authenticatedUser = ApiUser::GetByAuthHeader(request[http::field::authorization].to_string()); + authenticatedUser = ApiUser::GetByAuthHeader(std::string(request[http::field::authorization])); } Log logMsg (LogInformation, "HttpServerConnection");