Unable to set custom header

2015-10-06 Thread Ashish Mukherjee
Hello, I am trying to set a custom header through a mod_perl handler. My perl handler code is: sub handler { my $r = shift; $r->headers_out->add("foo" => "bar"); $r->log->error($r->connection->remote_ip()." is client IP"); return Apache2::Const::OK; } The handler gets called a

Re: Unable to set custom header

2015-10-06 Thread Jie Gao
Please think of our environment and only print this e-mail if necessary. * Ashish Mukherjee wrote: > Date: Tue, 6 Oct 2015 14:36:32 +0530 > From: Ashish Mukherjee > To: modperl@perl.apache.org > CC: sourabh@smartinsight.jp > Subject: Unable to set custom header > > Hello, > > I am trying

Re: Unable to set custom header

2015-10-06 Thread Ashish Mukherjee
Yes, I used that code just to try with foo => bar first, before doing anything more complex. err_headers_out() does not work either. Should I set this handler in some other phase? On Tue, Oct 6, 2015 at 2:53 PM, Jie Gao wrote: > Please think of our environment and only print this e-mail if neces

Re: Unable to set custom header

2015-10-06 Thread Jie Gao
* Ashish Mukherjee wrote: > Date: Tue, 6 Oct 2015 15:06:21 +0530 > From: Ashish Mukherjee > To: Jie Gao > CC: modperl@perl.apache.org, sourabh@smartinsight.jp > Subject: Re: Unable to set custom header > > Yes, I used that code just to try with foo => bar first, before doing > anything mor

Re: Unable to set custom header

2015-10-06 Thread Ashish Mukherjee
Error log does not show anything. It's almost as if that piece of code never existed! The request is already being created by mod_proxy. I am just trying to append some request headers. On Tue, Oct 6, 2015 at 3:25 PM, Jie Gao wrote: > * Ashish Mukherjee wrote: > > > Date: Tue, 6 Oct 2015 15:06

Re: Unable to set custom header

2015-10-06 Thread Issac Goldstand
$r->headers_out is what would go to the client. You probably want to add your headers to $r->headers_in to get it passed to the upstream server. Issac On 10/6/2015 1:11 PM, Ashish Mukherjee wrote: > Error log does not show anything. It's almost as if that piece of code > never existed! > > Th