Changeset 45

Show
Ignore:
Timestamp:
04/21/09 19:07:47 (5 years ago)
Author:
clinton
Message:

Send HTTP headers regardless of status code

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/Mungo/Cookie.pm

    r35 r45  
    137137    my $cookiestr = $self->make_cookie_string($cname, $info); 
    138138    $r->can('headers_out') ? 
    139       $r->headers_out->add('Set-Cookie', $cookiestr) : 
    140       $r->header_out('Set-Cookie', $cookiestr); 
     139      $r->err_headers_out->add('Set-Cookie', $cookiestr) : 
     140      $r->err_header_out('Set-Cookie', $cookiestr); 
    141141  } 
    142142  return; 
  • trunk/lib/Mungo/Response.pm

    r42 r45  
    129129  else { 
    130130    if($r->can('headers_out')) { 
    131       $r->headers_out->set('Cache-Control' => $_r->{data}->{CacheControl}); 
     131      $r->err_headers_out->set('Cache-Control' => $_r->{data}->{CacheControl}); 
    132132    } 
    133133    else { 
    134       $r->header_out('Cache-Control' => $_r->{data}->{CacheControl}); 
     134      $r->err_header_out('Cache-Control' => $_r->{data}->{CacheControl}); 
    135135    } 
    136136  } 
     
    177177  my $r = $_r->{data}->{'Apache::Request'}; 
    178178  die "Headers already sent." if($_r->{data}->{'__HEADERS_SENT__'}); 
    179   $r->can('headers_out') ? $r->headers_out->set(@_) : $r->header_out(@_); 
     179  $r->can('headers_out') ? $r->err_headers_out->set(@_) : $r->err_header_out(@_); 
    180180} 
    181181sub Cookies { 
     
    203203  $_r->{data}->{Status} = shift || 302; 
    204204  my $r = $_r->{data}->{'Apache::Request'}; 
    205   $r->can('headers_out') ? $r->headers_out->set('Location', $url) : 
    206                            $r->header_out('Location', $url); 
     205  $r->can('headers_out') ? $r->err_headers_out->set('Location', $url) : 
     206                           $r->err_header_out('Location', $url); 
    207207  $self->send_http_header(); 
    208208  $self->End();