diff options
Diffstat (limited to 'crow')
-rw-r--r-- | crow/include/crow/http_connection.h | 2 | ||||
-rw-r--r-- | crow/include/crow/http_request.h | 10 | ||||
-rw-r--r-- | crow/include/crow/http_response.h | 15 | ||||
-rw-r--r-- | crow/include/crow/routing.h | 2 | ||||
-rw-r--r-- | crow/include/crow/utility.h | 2 | ||||
-rw-r--r-- | crow/include/crow/websocket.h | 2 |
6 files changed, 16 insertions, 17 deletions
diff --git a/crow/include/crow/http_connection.h b/crow/include/crow/http_connection.h index f056f278e0..c02f4ec1e3 100644 --- a/crow/include/crow/http_connection.h +++ b/crow/include/crow/http_connection.h @@ -474,7 +474,7 @@ class Connection // Compute the url parameters for the request req->url = req->target(); std::size_t index = req->url.find("?"); - if (index != boost::string_view::npos) + if (index != std::string_view::npos) { req->url = req->url.substr(0, index); } diff --git a/crow/include/crow/http_request.h b/crow/include/crow/http_request.h index 7de618ffdb..0ba02664de 100644 --- a/crow/include/crow/http_request.h +++ b/crow/include/crow/http_request.h @@ -13,7 +13,7 @@ namespace crow struct Request { boost::beast::http::request<boost::beast::http::string_body>& req; - boost::string_view url{}; + std::string_view url{}; QueryString urlParams{}; bool isSecure{false}; @@ -32,22 +32,22 @@ struct Request return req.method(); } - const boost::string_view getHeaderValue(boost::string_view key) const + const std::string_view getHeaderValue(std::string_view key) const { return req[key]; } - const boost::string_view getHeaderValue(boost::beast::http::field key) const + const std::string_view getHeaderValue(boost::beast::http::field key) const { return req[key]; } - const boost::string_view methodString() const + const std::string_view methodString() const { return req.method_string(); } - const boost::string_view target() const + const std::string_view target() const { return req.target(); } diff --git a/crow/include/crow/http_response.h b/crow/include/crow/http_response.h index 1deae34fbb..093bd90423 100644 --- a/crow/include/crow/http_response.h +++ b/crow/include/crow/http_response.h @@ -24,12 +24,12 @@ struct Response nlohmann::json jsonValue; - void addHeader(const boost::string_view key, const boost::string_view value) + void addHeader(const std::string_view key, const std::string_view value) { stringResponse->set(key, value); } - void addHeader(boost::beast::http::field key, boost::string_view value) + void addHeader(boost::beast::http::field key, std::string_view value) { stringResponse->set(key, value); } @@ -43,13 +43,12 @@ struct Response { } - explicit Response(boost::string_view body_) : - stringResponse(response_type{}) + explicit Response(std::string_view body_) : stringResponse(response_type{}) { stringResponse->body() = std::string(body_); } - Response(boost::beast::http::status code, boost::string_view s) : + Response(boost::beast::http::status code, std::string_view s) : stringResponse(response_type{}) { stringResponse->result(code); @@ -94,7 +93,7 @@ struct Response return stringResponse->result_int(); } - boost::string_view reason() + std::string_view reason() { return stringResponse->reason(); } @@ -132,7 +131,7 @@ struct Response completed = false; } - void write(boost::string_view body_part) + void write(std::string_view body_part) { stringResponse->body() += std::string(body_part); } @@ -153,7 +152,7 @@ struct Response } } - void end(boost::string_view body_part) + void end(std::string_view body_part) { write(body_part); end(); diff --git a/crow/include/crow/routing.h b/crow/include/crow/routing.h index 7ba5171158..746e115894 100644 --- a/crow/include/crow/routing.h +++ b/crow/include/crow/routing.h @@ -689,7 +689,7 @@ class Trie } std::pair<unsigned, RoutingParams> - find(const boost::string_view req_url, const Node* node = nullptr, + find(const std::string_view req_url, const Node* node = nullptr, unsigned pos = 0, RoutingParams* params = nullptr) const { RoutingParams empty; diff --git a/crow/include/crow/utility.h b/crow/include/crow/utility.h index 4bc7808945..a07c0415af 100644 --- a/crow/include/crow/utility.h +++ b/crow/include/crow/utility.h @@ -571,7 +571,7 @@ inline static std::string base64encodeUrlsafe(const char* data, size_t size) // TODO this is temporary and should be deleted once base64 is refactored out of // crow -inline bool base64Decode(const boost::string_view input, std::string& output) +inline bool base64Decode(const std::string_view input, std::string& output) { static const char nop = -1; // See note on encoding_data[] in above function diff --git a/crow/include/crow/websocket.h b/crow/include/crow/websocket.h index 6ce7e05a68..6901eb108f 100644 --- a/crow/include/crow/websocket.h +++ b/crow/include/crow/websocket.h @@ -73,7 +73,7 @@ template <typename Adaptor> class ConnectionImpl : public Connection { BMCWEB_LOG_DEBUG << "starting connection " << this; - boost::string_view protocol = req.getHeaderValue( + std::string_view protocol = req.getHeaderValue( boost::beast::http::field::sec_websocket_protocol); // Perform the websocket upgrade |