Skip to content

Commit

Permalink
Item469: fixed double Status header printing
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.foswiki.org/trunk@1352 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
GilmarSantosJr authored and GilmarSantosJr committed Dec 15, 2008
1 parent b5923e9 commit 2a5655a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 0 additions & 3 deletions core/lib/Foswiki/Engine/CGI.pm
Expand Up @@ -176,9 +176,6 @@ sub finalizeHeaders {
my ( $this, $res, $req ) = @_;
$this->SUPER::finalizeHeaders( $res, $req );

# make sure we always generate a status for the response
print 'Status: ' . $res->status()
if ( $res->status() && !defined( $res->headers->{status} ) );
my $hdr = $res->printHeaders;
print $hdr;
}
Expand Down
10 changes: 7 additions & 3 deletions core/lib/Foswiki/Response.pm
Expand Up @@ -245,9 +245,13 @@ Return a string of all headers, separated by CRLF
=cut

sub printHeaders {
my ($this) = shift;
my $CRLF = "\x0D\x0A";
my $hdr = '';
my ($this) = shift;
my $CRLF = "\x0D\x0A";
my $hdr = '';

# make sure we always generate a status for the response
$this->{headers}->{Status} = $this->status()
if ( $this->status() && !defined( $this->headers->{Status} ) );
foreach my $header ( keys %{ $this->{headers} } ) {
$hdr .= $header . ': ' . $_ . $CRLF
foreach $this->getHeader($header);
Expand Down

0 comments on commit 2a5655a

Please sign in to comment.