Hi!

I'm trying to figure out, how to Add / Modify the HTTP Headers like
Content Type, Cache aso...

on mod_perl 1 I've used:
 
$r->send_cgi_header($custom_headers);

but this won't work mod_perl 2...

I've searched in Apache::compat all I've found was the function header_out
that internally calls $r->headers_out()... 

Can somebody please tell me how to set the right headers???

Thanks a lot!


here is the code from Apache::compat


sub table_get_set {
    my($r, $table) = (shift, shift);
    my($key, $value) = @_;

    if (1 == @_) {
        return wantarray() 
            ?       ($table->get($key))
            : scalar($table->get($key));
    }
    elsif (2 == @_) {
        if (defined $value) {
            return wantarray() 
                ?        ($table->set($key, $value))
                :  scalar($table->set($key, $value));
        }
        else {
            return wantarray() 
                ?       ($table->unset($key))
                : scalar($table->unset($key));
        }
    }
    elsif (0 == @_) {
        return $table;
    }
    else {
        my $name = (caller(1))[3];
        warn "Usage: \$r->$name([key [,val]])";
    }
}

sub header_out {
    my $r = shift;
    return wantarray() 
        ?       ($r->table_get_set(scalar($r->headers_out), @_))
        : scalar($r->table_get_set(scalar($r->headers_out), @_));
}

Reply via email to