Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

mp2, STDIN/POST is clobbered by CGI->new($r);

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


ashley.pond.v at gmail

Aug 29, 2008, 3:35 PM

Post #1 of 2 (543 views)
Permalink
mp2, STDIN/POST is clobbered by CGI->new($r);

Hello everybody.

I've got an access handler that is checking some arguments before
passing the request off with DECLINED or redirecting back to login/home.

The first version broke PHP forms that used POST by using this idiom
to check for arguments:

my $cgi = CGI->new($r);

CGI, I am guessing, reads STDIN for the POST args, emptying it
(eof'ing it?). So, when an authenticated request is DECLINED and PHP
is next in line, there is nothing to read and the $_POST is empty.

I realized I only needed to check GET args for the session info so
munging $r->args is fine for my situation. Problem solved but now I'm
curious.

How could you read the POST body without clobbering it to hand off to
some PHP, or whatever is next in line? My CGI version in this
environment is 3.15.

Thanks!
-Ashley


perrin at elem

Sep 2, 2008, 12:34 PM

Post #2 of 2 (490 views)
Permalink
Re: mp2, STDIN/POST is clobbered by CGI->new($r); [In reply to]

On Fri, Aug 29, 2008 at 6:35 PM, Ashley Pond V <ashley.pond.v[at]gmail.com> wrote:
> How could you read the POST body without clobbering it to hand off to some
> PHP, or whatever is next in line?

I don't think you can. Usually people use something like libapreq to
get around this, since it can just keep the parsed data and let you
use it across multiple phases, but that only works when everyone is
calling libapreq for their data.

- Perrin

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact lists@gossamer-threads.com
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.