Formatted header from script. Bad header = HTTP / 1.1 302 Found

I have a C ++ program acting like a CGI script, and I'm currently using Cgicc to parse and format for me (although at some point it will probably be replaced). When building my answer I use cgicc::HttpResponseHeaderthat will create me something like

HTTP/1.1 302 Found
Location: www.bla.com

This looks pretty standard to me. However, the web server is choking on this, giving me

<...> malformed header from script. Bad header=HTTP/1.1 302 Found: script.cgi

I found out how to fix it:

  • Delete line HTTP/...
  • Add a line instead Status: 302 Found

And actually this is exactly what it does cgicc::HttpRedirectHeader. I have two questions:

  • Is this line HTTP/1.1 302 Foundnot standard?
  • , cgicc::HttpResponseHeader ? , - ?

. , , . , .

Ole

+5
1

HTTP - HTTP, CGI.

CGI script Status -, - HTTP .

cgicc HTTP, , - , ? , nph? , - :

cgicc:: HTTPResponseHeader - , HTTP, HTTP.

, CGI script.

+5

All Articles