> -----Original Message-----
> From: Jochen Schnapka [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, April 19, 2001 6:31 AM
> To: [EMAIL PROTECTED]
> Subject: Re: which Handler to adjust Response-Headers?
> 
> 
> Hi again. Once again, I found the solution by myself.
> 
> On Wed, Apr 18, 2001 at 05:13:21PM +0200, Jochen Schnapka wrote:
> > Hi.
> > 
> > I wonder, which Handler I would have to invoke to mangle or 
> adjust the
> > response headers. I thought, this was the PerlFixupHandler.
>> But
> > $r->headers_out seems to be completly empty.

I think $r->headers_out will be empty until you do something to put
something in it (like $r->headers_out->add(), $r->no_cache(1), or
$r->send_http_headers()).  Depending on which modules you have in your
apache binary (like maybe mod_expires?), there may be no activity that sets
headers until you call $r->send_http_headers().

if you are interested, you can use Apache::DebugInfo and set up a
Perl*Handler for each phase and see what is added when:

PerlInitHandler 'sub { my $debug = Apache::DebugInfo->new(shift);
$debug->headers_out; };'
PerlFixupHandler 'sub { my $debug = Apache::DebugInfo->new(shift);
$debug->headers_out; };'
PerlCleanupHandler 'sub { my $debug = Apache::DebugInfo->new(shift);
$debug->headers_out; };'

or whatever... 

[snip]

> 
> Hehe, but this works:
> 
> $r->request->headers_out ...

huh?  that doesn't make sense to me...

> 
> So headers_out is located beneath the request sub-object (or 
> however you
> like to call it). Unfortunately this is not clearly 
> documented (I read the
> online book, chapter 7 and 9). 
> 
> I feel, that some methods can be accessed directly from top (as
> headers_in()), others not (like headers_out) :-(
> 
> Maybe this should be fixed or documented, otherwise somebody tell me
> please, if I am completly wrong :-)

that's more likely ;)

--Geoff

 

Reply via email to