Skip to main content

parse_cgi_response

Function parse_cgi_response 

Source
pub fn parse_cgi_response(output: &[u8]) -> Result<Response<Body>, ProxyError>
Expand description

Parse the raw CGI output (headers \r\n\r\n or \n\n separated from body) into an HTTP response.

The output has the form:

Status: 200 OK\r\n
Content-Type: text/html\r\n
\r\n
<html>...</html>

The Status pseudo-header is consumed and used to set the response status. All other headers are forwarded verbatim. If Status is absent, 200 is assumed.