| 913 | return 0; |
| 914 | } |
| 915 | int op_proxy_echo_handler(void*, Request& req, Response& resp, std::string_view) { |
| 916 | // Verify the request path was correctly forwarded |
| 917 | URL req_url(req.target()); |
| 918 | EXPECT_EQ(req_url.path(), "/echo"); |
| 919 | // Echo: read the request body and send it back as-is |
| 920 | auto body_len = req.headers.content_length(); |
| 921 | resp.set_result(200); |
| 922 | resp.headers.content_length(body_len); |
| 923 | char buf[4096]; |
| 924 | ssize_t n; |
| 925 | while ((n = req.read(buf, sizeof(buf))) > 0) { |
| 926 | resp.write(buf, n); |
| 927 | } |
| 928 | return 0; |
| 929 | } |
| 930 | } // anonymous namespace |
| 931 | |
| 932 | TEST(http_client, operation_level_proxy_e2e) { |
nothing calls this directly
no test coverage detected