cgi.rb

A

ako...

Hello,

i am looking at cgi.rb module, and it looks like it produces valid HTTP
responses such as

HTTP/1.1 404 Not Found
Date: Tue, 29 Nov 2005 06:52:21 GMT\r\n
Content-Length: 0\r\n
Connection: close\r\n
Content-Type: text/html\r\n
\r\n
....

what i expected it to produce is CGI headers so that the web server (I
am using Apache) could interpret the CGI response correctly and act on
it:

Status: 404 Not Found\r\n
Content-Type: text/html\r\n
\r\n
....

has anyone used cgi.rb? i know rails, nitro etc use it. has anyone
noticed this? can this be controlled?

thanks
konstantin
 
N

Nick Sieger

------=_Part_2478_23118853.1133297006804
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
i am looking at cgi.rb module, and it looks like it produces valid HTTP
responses such as

HTTP/1.1 404 Not Found
Date: Tue, 29 Nov 2005 06:52:21 GMT\r\n
Content-Length: 0\r\n
Connection: close\r\n
Content-Type: text/html\r\n
\r\n
....

what i expected it to produce is CGI headers so that the web server (I
am using Apache) could interpret the CGI response correctly and act on
it:

Status: 404 Not Found\r\n
Content-Type: text/html\r\n
\r\n
....

has anyone used cgi.rb? i know rails, nitro etc use it. has anyone
noticed this? can this be controlled?


Are you setting "nph" =3D> true when calling CGI#out or CGI#header? If you
are, you probably don't want to. I believe that controls whether or not th=
e
HTTP version and response are printed (among other variables like whether
you're using mod_ruby or IIS). See line 559 of cgi.rb in a Ruby
1.8.2distro for details.

Cheers,
/Nick

------=_Part_2478_23118853.1133297006804--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,197
Messages
2,571,040
Members
47,642
Latest member
arunkumar99

Latest Threads

Top