@@ -857,27 +857,27 @@ TEST(CallbackDataTests, CallbackReadFunctionChunkedTest) {
857857
858858TEST (CallbackDataTests, CallbackHeaderFunctionCancelTest) {
859859 Url url{server->GetBaseUrl () + " /url_post.html" };
860- Response response = Post (url, HeaderCallback{[](const std::string_view& /* header*/ , intptr_t /* userdata*/ ) -> bool { return false ; }});
860+ Response response = Post (url, HeaderCallback{[](const std::string_view /* header*/ , intptr_t /* userdata*/ ) -> bool { return false ; }});
861861 EXPECT_TRUE ((response.error .code == ErrorCode::ABORTED_BY_CALLBACK) || (response.error .code == ErrorCode::WRITE_ERROR));
862862}
863863
864864TEST (CallbackDataTests, CallbackHeaderFunctionTextTest) {
865865 Url url{server->GetBaseUrl () + " /url_post.html" };
866866 std::vector<std::string> expected_headers{" HTTP/1.1 201 Created\r\n " , " Content-Type: application/json\r\n " , " \r\n " };
867867 std::set<std::string> response_headers;
868- Post (url, HeaderCallback{[&response_headers](const std::string_view& header, intptr_t /* userdata*/ ) -> bool {
868+ Post (url, HeaderCallback{[&response_headers](const std::string_view header, intptr_t /* userdata*/ ) -> bool {
869869 response_headers.insert (std::string{header});
870870 return true ;
871871 }});
872- for (std::string& header : expected_headers) {
872+ for (const std::string& header : expected_headers) {
873873 std::cout << header << ' \n ' ;
874874 EXPECT_TRUE (response_headers.count (header));
875875 }
876876}
877877
878878TEST (CallbackDataTests, CallbackWriteFunctionCancelTest) {
879879 Url url{server->GetBaseUrl () + " /url_post.html" };
880- Response response = Post (url, WriteCallback{[](const std::string_view& /* header*/ , intptr_t /* userdata*/ ) -> bool { return false ; }});
880+ Response response = Post (url, WriteCallback{[](const std::string_view /* header*/ , intptr_t /* userdata*/ ) -> bool { return false ; }});
881881 EXPECT_TRUE ((response.error .code == ErrorCode::ABORTED_BY_CALLBACK) || (response.error .code == ErrorCode::WRITE_ERROR));
882882}
883883
@@ -888,7 +888,7 @@ TEST(CallbackDataTests, CallbackWriteFunctionTextTest) {
888888 " \" x\" : 5\n "
889889 " }" };
890890 std::string response_text;
891- Post (url, Payload{{" x" , " 5" }}, WriteCallback{[&response_text](const std::string_view& header, intptr_t /* userdata*/ ) -> bool {
891+ Post (url, Payload{{" x" , " 5" }}, WriteCallback{[&response_text](const std::string_view header, intptr_t /* userdata*/ ) -> bool {
892892 response_text.append (header);
893893 return true ;
894894 }});
@@ -919,7 +919,7 @@ TEST(CallbackDataTests, CallbackDebugFunctionTextTest) {
919919 Url url{server->GetBaseUrl () + " /url_post.html" };
920920 Body body{" x=5" };
921921 std::string debug_body;
922- Response response = Post (url, body, DebugCallback{[&](DebugCallback::InfoType type, const std::string& data, intptr_t /* userdata*/ ) {
922+ Response response = Post (url, body, DebugCallback{[&](DebugCallback::InfoType type, std::string_view data, intptr_t /* userdata*/ ) {
923923 if (type == DebugCallback::InfoType::DATA_OUT) {
924924 debug_body = data;
925925 }
0 commit comments