Merge pull request #9624 from Icinga/9618

Make compilable on Boost v1.81
This commit is contained in:
Julian Brost 2023-01-05 15:32:22 +01:00 committed by GitHub
commit dd51997c73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 8 deletions

View File

@ -128,15 +128,15 @@ String::operator const std::string&() const
}
/**
* Conversion function to boost::string_view.
* Conversion function to boost::beast::string_view.
*
* This allows using String as the value for HTTP headers in boost::beast::http::basic_fields::set.
*
* @return A boost::string_view representing this string.
* @return A boost::beast::string_view representing this string.
*/
String::operator boost::string_view() const
String::operator boost::beast::string_view() const
{
return boost::string_view(m_Data);
return boost::beast::string_view(m_Data);
}
const char *String::CStr() const

View File

@ -5,6 +5,7 @@
#include "base/i2-base.hpp"
#include "base/object.hpp"
#include <boost/beast/core.hpp>
#include <boost/range/iterator.hpp>
#include <boost/utility/string_view.hpp>
#include <functional>
@ -73,7 +74,7 @@ public:
bool operator<(const String& rhs) const;
operator const std::string&() const;
operator boost::string_view() const;
operator boost::beast::string_view() const;
const char *CStr() const;

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