You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by Stas Bekman <st...@stason.org> on 2004/06/18 14:45:05 UTC

Re: [mp2] losing POST vars with PerlOutputFilterHandler+mod_proxy

That should probably go somewhere into A-R docs?

Eric J. Hansen wrote:
> Thanks, Joe!  I implemented your suggestion (1), and the following works nicely...
> (added to my request filter)
> 
> sub init : FilterInitHandler {
>         my $f = shift;
>         my $r = $f->r;
> 
>         # instantiate an Apache::Request object here so we have access to
>         # CGI params during the output filter
>         my $ApReq = Apache::Request->new($r);
>         return 1;
> }
> 
> sub handler : FilterRequestHandler FilterHasInitHandler(\&init) {
> ........
> 
> 
> My output filter stayed the same -- I simply (re)instantiate Apache::Request,
> then $ApReq->param, and I've got access to the form variables.  :)
> 
> cheers
> Eric
> 
> 
> 
> 
> 
>>-----Original Message-----
>>From: news [mailto:news@sea.gmane.org] On Behalf Of Joe Schaefer
>>Sent: Friday, June 18, 2004 12:25 AM
>>To: modperl@perl.apache.org
>>Subject: Re: [mp2] losing POST vars with 
>>PerlOutputFilterHandler+mod_proxy
>>
>>
>>"Eric J. Hansen" <eh...@worldmachine.com> writes:
>>
>>
>>>I'm having a problem whereby I can't access POST CGI variables when 
>>>using an output filter (PerlOutputFilterHandler) alongside mod_proxy. 
>>>Parameters on the URL (GET) work just fine, its just the POST 
>>>variables that are missing.
>>>
>>>My setup is that I'm using a mod_proxy reverse proxy to fetch some 
>>>remote content, then doing some analysis on the content using an 
>>>output filter.
>>
>>The problem is likely that the apreq filter has not been added to 
>>the input filter chain in time to read the POST data.
>>
>>There are two solutions to this problem:
>>
>>  1) Write a filter init handler for you filter that instantiates an
>>     Apache::Request object.  See
>>
>>     http://perl.apache.org/docs/2.0/api/Apache/Filter.html#C_FilterInitHandler_
>>
>>[....]
> 
> 
> 
> 


-- 
__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

Re: [mp2] losing POST vars with PerlOutputFilterHandler+mod_proxy

Posted by Joe Schaefer <jo...@sunstarsys.com>.
Stas Bekman <st...@stason.org> writes:

> That should probably go somewhere into A-R docs?

Yup.  It's may be time to start a FAQ or a Wiki too.

-- 
Joe Schaefer