Frame brokered HTTP responses once

This commit is contained in:
root
2026-07-18 01:33:57 +00:00
parent 6e4ef8ed7a
commit f89e33e241
6 changed files with 26 additions and 2 deletions
+5
View File
@@ -421,6 +421,11 @@ void cli_run_tcp_smoke()
cli_test_case("uce_tcp_smoke:http websocket port 8080", fd8080 != 0, "TCP connect " + String(fd8080 != 0 ? "succeeded" : "failed") + " on port 8080");
if(fd8080 != 0)
socket_close(fd8080);
CliHttpResponse direct = cli_direct_http("/tests/pool-isolation.uce?token=raw-http-framing");
StringList direct_parts = split(trim(direct.body), "|");
bool one_response = direct.status == 200 && direct_parts.size() == 3 && direct_parts[0] == "fresh" && direct_parts[1] == "raw-http-framing" && direct.body.find("HTTP/1.1 ") == String::npos;
cli_test_case("uce_tcp_smoke:raw HTTP dynamic response is framed once", one_response,
one_response ? "single status/header block and exact dynamic body" : "status=" + std::to_string(direct.status) + " body=" + cli_truncate(direct.body));
}
void cli_run_wasm_kill(bool include_kill)
+1 -1
View File
@@ -66,7 +66,7 @@ RENDER(Request& context)
socket_close(stopped_sockfd);
mark(
"server_start_http() / SERVE_HTTP:named / server_stop()",
(custom_http_pid != 0 && write_ok && response.find("custom-http-named") != String::npos && response.find("query=alpha=1") != String::npos && stopped && listener_closed) ? "pass" : "fail",
(custom_http_pid != 0 && write_ok && response.find("custom-http-named") != String::npos && response.find("query=alpha=1") != String::npos && response.find("\r\nHTTP/1.1 ") == String::npos && stopped && listener_closed) ? "pass" : "fail",
response.substr(0, response.length() > 260 ? 260 : response.length()) + " stopped=" + (stopped ? "true" : "false") + " listener_closed=" + (listener_closed ? "true" : "false")
);
}