From: Christian Hansen Date: Wed, 23 Mar 2005 04:26:22 +0000 (+0000) Subject: cleaning up Catalyst::Engine::CGI::NPH X-Git-Tag: 5.7099_04~1718 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c038f8ff7508fbef3936280c2ff74de70d85bb8e;hp=d8c1e61236972c22452ef3f5ec9407181ad74ea0;p=catagits%2FCatalyst-Runtime.git cleaning up Catalyst::Engine::CGI::NPH --- diff --git a/lib/Catalyst/Engine/CGI/NPH.pm b/lib/Catalyst/Engine/CGI/NPH.pm index 96699a0..403be8e 100644 --- a/lib/Catalyst/Engine/CGI/NPH.pm +++ b/lib/Catalyst/Engine/CGI/NPH.pm @@ -3,6 +3,8 @@ package Catalyst::Engine::CGI::NPH; use strict; use base 'Catalyst::Engine::CGI'; +use HTTP::Status (); + =head1 NAME Catalyst::Engine::CGI::NPH - Catalyst CGI Engine @@ -27,24 +29,10 @@ This class overloads some methods from C. sub finalize_headers { my $c = shift; - my %headers = ( -nph => 1 ); - $headers{-status} = $c->response->status if $c->response->status; - for my $name ( $c->response->headers->header_field_names ) { - $headers{"-$name"} = $c->response->headers->header($name); - } - my @cookies; - while ( my ( $name, $cookie ) = each %{ $c->response->cookies } ) { - push @cookies, $c->cgi->cookie( - -name => $name, - -value => $cookie->{value}, - -expires => $cookie->{expires}, - -domain => $cookie->{domain}, - -path => $cookie->{path}, - -secure => $cookie->{secure} || 0 - ); - } - $headers{-cookie} = \@cookies if @cookies; - print $c->cgi->header(%headers); + + my $status = $c->response->status || 200; + printf( "%d %s\n", $status, HTTP::Status::status_message($status) ); + $c->SUPER::finalize_headers; } =back