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
+7 -1
View File
@@ -855,7 +855,13 @@ static String custom_server_dispatcher_key = "";
int forward_request_to_worker(FastCGIRequest& request, u32 timeout_seconds = 30)
{
String fcgi_socket = first(server_state.config["FCGI_SOCKET_PATH"], "/run/uce.sock");
FcgiForwardResult fwd = fcgi_forward_request(fcgi_socket, request.params, request.in, timeout_seconds);
StringMap forward_params = request.params;
// The broker accepted raw HTTP, but this hop is FastCGI. Without the CGI
// marker Request::set_status() emits an HTTP status line that the FastCGI
// reply parser correctly treats as body; the broker would then wrap that
// complete response in a second HTTP response.
forward_params["GATEWAY_INTERFACE"] = "CGI/1.1";
FcgiForwardResult fwd = fcgi_forward_request(fcgi_socket, forward_params, request.in, timeout_seconds);
request.ob_start();
if(!fwd.ok)
{