Skip to content

Commit

Permalink
Fix belle string_view.to_string BH 1.81
Browse files Browse the repository at this point in the history
  • Loading branch information
nx10 committed Jan 7, 2023
1 parent 9f552cb commit 6e094f4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/lib/belle.h
Original file line number Diff line number Diff line change
Expand Up @@ -834,7 +834,7 @@ class Request : public http::request<http::string_body>
// 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);
Expand All @@ -856,7 +856,7 @@ class Request : public http::request<http::string_body>
// 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);
Expand Down Expand Up @@ -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() == '/')
{
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit 6e094f4

Please sign in to comment.