[Mungo-devel] [mungo commit] r45 - trunk/lib/Mungo

svn-commit at lists.omniti.com svn-commit at lists.omniti.com
Tue Apr 21 15:07:47 EDT 2009


Author: clinton
Date: 2009-04-21 15:07:47 -0400 (Tue, 21 Apr 2009)
New Revision: 45

Modified:
   trunk/lib/Mungo/Cookie.pm
   trunk/lib/Mungo/Response.pm
Log:
Send HTTP headers regardless of status code

Modified: trunk/lib/Mungo/Cookie.pm
===================================================================
--- trunk/lib/Mungo/Cookie.pm	2009-03-25 15:31:13 UTC (rev 44)
+++ trunk/lib/Mungo/Cookie.pm	2009-04-21 19:07:47 UTC (rev 45)
@@ -136,8 +136,8 @@
   while(my ($cname, $info) = each %$self) {
     my $cookiestr = $self->make_cookie_string($cname, $info);
     $r->can('headers_out') ?
-      $r->headers_out->add('Set-Cookie', $cookiestr) :
-      $r->header_out('Set-Cookie', $cookiestr);
+      $r->err_headers_out->add('Set-Cookie', $cookiestr) :
+      $r->err_header_out('Set-Cookie', $cookiestr);
   }
   return;
 }

Modified: trunk/lib/Mungo/Response.pm
===================================================================
--- trunk/lib/Mungo/Response.pm	2009-03-25 15:31:13 UTC (rev 44)
+++ trunk/lib/Mungo/Response.pm	2009-04-21 19:07:47 UTC (rev 45)
@@ -128,10 +128,10 @@
   }
   else {
     if($r->can('headers_out')) {
-      $r->headers_out->set('Cache-Control' => $_r->{data}->{CacheControl});
+      $r->err_headers_out->set('Cache-Control' => $_r->{data}->{CacheControl});
     }
     else {
-      $r->header_out('Cache-Control' => $_r->{data}->{CacheControl});
+      $r->err_header_out('Cache-Control' => $_r->{data}->{CacheControl});
     }
   }
   # Must use Internal as the tiehash is magic for cookies
@@ -176,7 +176,7 @@
   my $_r = tied %$self;
   my $r = $_r->{data}->{'Apache::Request'};
   die "Headers already sent." if($_r->{data}->{'__HEADERS_SENT__'});
-  $r->can('headers_out') ? $r->headers_out->set(@_) : $r->header_out(@_);
+  $r->can('headers_out') ? $r->err_headers_out->set(@_) : $r->err_header_out(@_);
 }
 sub Cookies {
   my $self = shift;
@@ -202,8 +202,8 @@
   die "Cannot redirect, headers already sent\n" if($_r->{data}->{'__HEADERS_SENT__'});
   $_r->{data}->{Status} = shift || 302;
   my $r = $_r->{data}->{'Apache::Request'};
-  $r->can('headers_out') ? $r->headers_out->set('Location', $url) :
-                           $r->header_out('Location', $url);
+  $r->can('headers_out') ? $r->err_headers_out->set('Location', $url) :
+                           $r->err_header_out('Location', $url);
   $self->send_http_header();
   $self->End();
 }



More information about the Mungo-devel mailing list