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.)
This commit is contained in:
Alexander A. Klimov 2023-01-04 17:34:49 +01:00
parent 68198f2ef9
commit f84ffdad68
2 changed files with 3 additions and 3 deletions

View File

@ -58,7 +58,7 @@ void HttpHandler::ProcessRequest(
Dictionary::Ptr node = m_UrlTree;
std::vector<HttpHandler::Ptr> 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<String>::size_type i = 0; i <= path.size(); i++) {

View File

@ -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");