| 643 | } |
| 644 | |
| 645 | int ua_check_handler(void*, Request &req, Response &resp, std::string_view) { |
| 646 | auto ua = req.headers["User-Agent"]; |
| 647 | LOG_DEBUG(VALUE(ua)); |
| 648 | EXPECT_EQ(ua, "TEST_UA"); |
| 649 | resp.set_result(200); |
| 650 | std::string str = "success"; |
| 651 | resp.headers.content_length(7); |
| 652 | resp.write((void*)str.data(), str.size()); |
| 653 | return 0; |
| 654 | } |
| 655 | |
| 656 | TEST(http_client, user_agent) { |
| 657 | auto tcpserver = new_tcp_socket_server(); |
nothing calls this directly
no test coverage detected