perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivory <ivoryma...@msn.com>
Subject Adding args to a Request through InputFilter
Date Tue, 19 Jan 2010 16:11:03 GMT

Hi,

I would like to add args to a request on the fly thanks to an InputFilter.

It seems like the $f->r->args($new_args) doesn't record the new argument
inside the request.

For example :

Inside the filter :
sub handler{

    my ($f, $bb, $mode, $block, $readbytes) = @_; # filter args # $mode,
$block, $readbytes are passed only for input filters

    my $rv = $f->next->get_brigade($bb, $mode, $block, $readbytes);
    return $rv unless $rv == APR::Const::SUCCESS;
    
    print STDOUT "Perlfilter : Uri = ", $f->r->uri(),"\n";	
    print STDOUT $f->r->args(),"\n"; #No argument
    $f->r->args("userId=10");
    print STDOUT $f->r->args(),"\n"; #Returns the arg I passed
}

In a running perl script on my apache the $r->args() doesn't return
anything.

As I'm a newbie using mod_perl, a little help would be appreciated :)

Ivory
-- 
View this message in context: http://old.nabble.com/Adding-args-to-a-Request-through-InputFilter-tp27228223p27228223.html
Sent from the mod_perl - General mailing list archive at Nabble.com.


Mime
View raw message