X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=lib%2FMaypole%2FHeaders.pm;h=28675fce3dd0252b1e75a89dce92f6e6d6007ad3;hb=07f3f8fcee38924da9aa2b78864a61843a4fd84b;hp=16646faad9fcd88d58c897b0eb5eb40381b90cd3;hpb=b91bc53de6872ec4b22779382f6955b3af7c6fd5;p=maypole.git diff --git a/lib/Maypole/Headers.pm b/lib/Maypole/Headers.pm index 16646fa..28675fc 100644 --- a/lib/Maypole/Headers.pm +++ b/lib/Maypole/Headers.pm @@ -4,7 +4,7 @@ use base 'HTTP::Headers'; use strict; use warnings; -our $VERSION = "1." . sprintf "%04d", q$Rev$ =~ /: (\d+)/; +our $VERSION = "1." . sprintf "%04d", q$Rev: 376 $ =~ /: (\d+)/; sub get { shift->header(shift); @@ -14,6 +14,8 @@ sub set { shift->header(@_); } +*add = \&push; # useful for Apache::Session::Wrapper support + sub push { shift->push_header(@_); } @@ -54,11 +56,11 @@ Maypole::Headers - Convenience wrapper around HTTP::Headers A convenience wrapper around C. Additional methods are provided to make the mutators less repetitive and wordy. For example: - $r->headers->header(Content_Base => $r->config->uri_base); + $r->headers_out->header(Content_Base => $r->config->uri_base); can be written as: - $r->headers->set(Content_Base => $r->config->uri_base); + $r->headers_out->set(Content_Base => $r->config->uri_base); =head1 METHODS @@ -84,6 +86,10 @@ Add a value to the field named C<$header>. Previous values are maintained. An alias to Cpush_header> +=item add + +Alias to C - useful for C support, in CGI mode. + =item init($header =C $value) Set the value for the field named C<$header>, but only if that header is @@ -109,7 +115,7 @@ An alias to Cheader_field_names> L -=head1 AUTHORS +=head1 AUTHOR Simon Flack