Forum: Ruby cgi.rb

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
A70b7da5a3a712e800100e61ef8d8917?d=identicon&s=25 akonsu (Guest)
on 2005-11-29 20:44
(Received via mailing list)
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
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 nicksieger (Guest)
on 2005-11-29 21:45
(Received via mailing list)
>
> noticed this? can this be controlled?
Are you setting "nph" => true when calling CGI#out or CGI#header?  If
you
are, you probably don't want to.  I believe that controls whether or not
the
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
This topic is locked and can not be replied to.