It works fine locally with Webrick, but on my staging server (running
passenger 2.2.5), it fails because the CGI stdinput is empty...
To be more descriptive, in the code (http://gist.github.com/55772) on
line 14, if I output @session.cgi.stdinput, I get an empty string on
my staging server.
On my local machine, I get the uploaded data with my session cookie at
the end (as expected).
I am confused: why would the standard input be empty?? Where do I go
from there? How could I debug what is going on?
> It works fine locally with Webrick, but on my staging server (running > passenger 2.2.5), it fails because the CGI stdinput is empty...
> To be more descriptive, in the code (http://gist.github.com/55772) on > line 14, if I output @session.cgi.stdinput, I get an empty string on > my staging server.
> On my local machine, I get the uploaded data with my session cookie at > the end (as expected).
> I am confused: why would the standard input be empty?? Where do I go > from there? How could I debug what is going on?
> Any suggestion welcome.
I'm not sure. Can you check whether @session.cgi is of class PhusionPassenger::Railz::CGIFixed?
-- Phusion | The Computer Science Company
Web: http://www.phusion.nl/ E-mail: i...@phusion.nl Chamber of commerce no: 08173483 (The Netherlands)
Yes it is. And @session.cgi.stdinput is of class UNIXSocket.
If I check @session.cgi.stdinput.eof? it says true.
So apparently the socket is closed... Is that expected?
Is it possible that the socket content has already been read? If so,
is there a way I can access the request body?
Cheers
Cyrille
On Sep 17, 7:28 pm, Hongli Lai <hon...@phusion.nl> wrote:
> > It works fine locally with Webrick, but on my staging server (running
> > passenger 2.2.5), it fails because the CGI stdinput is empty...
> > To be more descriptive, in the code (http://gist.github.com/55772) on
> > line 14, if I output @session.cgi.stdinput, I get an empty string on
> > my staging server.
> > On my local machine, I get the uploaded data with my session cookie at
> > the end (as expected).
> > I am confused: why would the standard input be empty?? Where do I go
> > from there? How could I debug what is going on?
> > Any suggestion welcome.
> I'm not sure. Can you check whether @session.cgi is of class
> PhusionPassenger::Railz::CGIFixed?
> --
> Phusion | The Computer Science Company
> Web:http://www.phusion.nl/ > E-mail: i...@phusion.nl
> Chamber of commerce no: 08173483 (The Netherlands)
On Thu, Sep 17, 2009 at 11:14 AM, Cyrille <cbonne...@gmail.com> wrote:
> Hi there,
> Yes it is. And @session.cgi.stdinput is of class UNIXSocket.
> If I check @session.cgi.stdinput.eof? it says true.
> So apparently the socket is closed... Is that expected? > Is it possible that the socket content has already been read? If so, > is there a way I can access the request body?
Yes, the socket is closed and its contents has probably already been read by Rails. If you can access the Rails request object you can extract the parameters from there.
-- Phusion | The Computer Science Company
Web: http://www.phusion.nl/ E-mail: i...@phusion.nl Chamber of commerce no: 08173483 (The Netherlands)
> On Thu, Sep 17, 2009 at 11:14 AM, Cyrille <cbonne...@gmail.com> wrote:
> > Hi there,
> > Yes it is. And @session.cgi.stdinput is of class UNIXSocket.
> > If I check @session.cgi.stdinput.eof? it says true.
> > So apparently the socket is closed... Is that expected?
> > Is it possible that the socket content has already been read? If so,
> > is there a way I can access the request body?
> Yes, the socket is closed and its contents has probably already been
> read by Rails. If you can access the Rails request object you can
> extract the parameters from there.
> --
> Phusion | The Computer Science Company
> Web:http://www.phusion.nl/ > E-mail: i...@phusion.nl
> Chamber of commerce no: 08173483 (The Netherlands)