]> git.decadent.org.uk Git - maypole.git/blobdiff - lib/Maypole/Headers.pm
add() alis to push() in Mp::Headers - bug 14142
[maypole.git] / lib / Maypole / Headers.pm
index a72f01c5b712b913a7b876bcf0ebbe7668025c68..320cb0541841aaa4fe1b0f96127f919cb84b6998 100644 (file)
@@ -14,6 +14,8 @@ sub set {
     shift->header(@_);
 }
 
+*add = \&push; # useful for Apache::Session::Wrapper support
+
 sub push {
     shift->push_header(@_);
 }
@@ -42,7 +44,7 @@ Maypole::Headers - Convenience wrapper around HTTP::Headers
 
     use Maypole::Headers;
 
-    $r->headers_out(Maypole::Headers->new);
+    $r->headers_out(Maypole::Headers->new); # Note, automatic in Maypole
     $r->headers_out->set('Content-Base' => 'http://localhost/maypole');
     $r->headers_out->push('Set-Cookie' => $cookie->as_string);
     $r->headers_out->push('Set-Cookie' => $cookie2->as_string);
@@ -54,11 +56,11 @@ Maypole::Headers - Convenience wrapper around HTTP::Headers
 A convenience wrapper around C<HTTP::Headers>. 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 C<HTTP::Headers-E<gt>push_header>
 
+=item add
+
+Alias to C<push> - useful for C<Apache::Session::Wrapper> support, in CGI mode.
+
 =item init($header =C<gt> $value)
 
 Set the value for the field named C<$header>, but only if that header is
@@ -109,7 +115,7 @@ An alias to C<HTTP::Headers-E<gt>header_field_names>
 
 L<HTTP::Headers>
 
-=head1 AUTHORS
+=head1 AUTHOR
 
 Simon Flack