On Thu, Apr 19, 2001 at 08:42:40AM -0400, Geoffrey Young wrote:

> > > $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().

but there *is* a bunch of headers, which is sent back, even if I do not
touch anything. and these headers must be readable somewhere, let it be
Content-Length, Type, Date, whatever...

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

[...]

> > Hehe, but this works:
> > 
> > $r->request->headers_out ...
> 
> huh?  that doesn't make sense to me...

But it works. And guess, where I stole the trick :-) Apache::DebugInfo !!

-- snip --

# Code from DebugInfo.pm

[...]

sub headers_out {
#---------------------------------------------------------------------
# dump all of the outbound response headers
#---------------------------------------------------------------------

  my $self              = shift;

# [...]

  my $r                 = $self->{request};
#  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
# [...]

  print $fh "\nDebug headers_out for [$ip] $uri during " .
    $r->current_callback . "\n";

  $r->headers_out->do(sub {
# ^^^^^^^^^^^^^^^
    my ($field, $value) = @_;
    if ($field =~ m/Cookie/) {
      my @values = split /;/, $value;
      print $fh "\t$field => $values[0]\n";
      for (my $i=1;$i < @values; $i++) {
        print $fh "\t\t=> $values[$i]\n";
      }
    }

[...]

-- snap --

> > Maybe this should be fixed or documented, otherwise somebody tell me
> > please, if I am completly wrong :-)
> 
> that's more likely ;)

Are you sure? ;-)
Maybe I'm partly wrong...

Greetings. ~~~:-Jochen

-- 
The human mind ordinarily operates at only ten percent of its capacity
-- the rest is overhead for the operating system.

Reply via email to