X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FCGI%2FNPH.pm;h=403be8ee25154e2c5836137c5994f240b3e579d2;hb=c038f8ff7508fbef3936280c2ff74de70d85bb8e;hp=96699a024e79d81fedb6d8a0d90cbce2bda4b3bb;hpb=d8c1e61236972c22452ef3f5ec9407181ad74ea0;p=catagits%2FCatalyst-Runtime.git 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