From 6e094f409e21e38bad598a9aab630ec07b34f33d Mon Sep 17 00:00:00 2001 From: Florian Rupprecht Date: Sat, 7 Jan 2023 22:59:19 +0100 Subject: [PATCH] Fix belle string_view.to_string BH 1.81 --- src/lib/belle.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/lib/belle.h b/src/lib/belle.h index 132236e..80bea39 100644 --- a/src/lib/belle.h +++ b/src/lib/belle.h @@ -834,7 +834,7 @@ class Request : public http::request // serialize path and query parameters to the target void params_serialize() { - std::string path {target().to_string()}; + std::string path {target().data(), target().size()}; _path.clear(); _path.emplace_back(path); @@ -856,7 +856,7 @@ class Request : public http::request // parse the query parameters from the target void params_parse() { - std::string path {target().to_string()}; + std::string path {target().data(), target().size()}; // separate the query params auto params = Detail::split(path, "?", 1); @@ -1610,7 +1610,7 @@ class Server return 404; } - std::string path {_attr->public_dir + _ctx.req.target().to_string()}; + std::string path {_attr->public_dir + std::string(_ctx.req.target().data(), _ctx.req.target().size())}; if (path.back() == '/') { @@ -1667,7 +1667,7 @@ class Server std::regex_constants::match_flag_type const rx_flgs {std::regex_constants::match_not_null}; // the request path - std::string path {_ctx.req.target().to_string()}; + std::string path {_ctx.req.target().data(),_ctx.req.target().size()}; // separate the query parameters auto params = Detail::split(path, "?", 1); @@ -1759,7 +1759,7 @@ class Server std::regex_constants::match_flag_type const rx_flgs {std::regex_constants::match_not_null}; // the request path - std::string path {_ctx.req.target().to_string()}; + std::string path {_ctx.req.target().data(), _ctx.req.target().size()}; // separate the query parameters auto params = Detail::split(path, "?", 1); @@ -1945,7 +1945,7 @@ class Server bool handle_websocket() { // the request path - std::string path {_ctx.req.target().to_string()}; + std::string path {_ctx.req.target().data(), _ctx.req.target().size()}; // separate the query parameters auto params = Detail::split(path, "?", 1);