X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine%2FApache.pm;fp=lib%2FCatalyst%2FEngine%2FApache.pm;h=a9685499cd83c795dcd2001ea7a9631f300cc550;hb=e7c0c583d6e12e822dd26bf1282eb610c9a59351;hp=3259c3bfeb017082894749e9ad59aa0a8e18eb71;hpb=597d4987a6929a19b18743ba111a6b55f2b3b496;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine/Apache.pm b/lib/Catalyst/Engine/Apache.pm index 3259c3b..a968549 100644 --- a/lib/Catalyst/Engine/Apache.pm +++ b/lib/Catalyst/Engine/Apache.pm @@ -1,9 +1,8 @@ package Catalyst::Engine::Apache; use strict; -use mod_perl; -use constant MP2 => $mod_perl::VERSION >= 1.99; use base 'Catalyst::Engine'; + use URI; use URI::http; @@ -37,34 +36,6 @@ This class overloads some methods from C. =over 4 -=item $c->finalize_headers - -=cut - -sub finalize_headers { - my $c = shift; - - for my $name ( $c->response->headers->header_field_names ) { - next if $name =~ /Content-Type/i; - my @values = $c->response->header($name); - $c->apache->headers_out->add( $name => $_ ) for @values; - } - - if ( $c->response->header('Set-Cookie') && $c->response->status >= 300 ) { - my @values = $c->response->header('Set-Cookie'); - $c->apache->err_headers_out->add( 'Set-Cookie' => $_ ) for @values; - } - - $c->apache->status( $c->response->status ); - $c->apache->content_type( $c->response->header('Content-Type') ); - - unless ( MP2 ) { - $c->apache->send_http_header; - } - - return 0; -} - =item $c->finalize_output =cut @@ -100,12 +71,11 @@ sub prepare_headers { sub prepare_parameters { my $c = shift; - my %args; + foreach my $key ( $c->apache->param ) { my @values = $c->apache->param($key); - $args{$key} = @values == 1 ? $values[0] : \@values; + $c->req->parameters->{$key} = ( @values == 1 ) ? $values[0] : \@values; } - $c->request->parameters( \%args ); } =item $c->prepare_path @@ -138,22 +108,6 @@ sub prepare_request { $c->apache( Apache::Request->new($r) ); } -=item $c->prepare_uploads - -=cut - -sub prepare_uploads { - my $c = shift; - for my $upload ( $c->apache->upload ) { - $upload = $c->apache->upload($upload) if MP2; - $c->request->uploads->{ $upload->filename } = { - fh => $upload->fh, - size => $upload->size, - type => $upload->type - }; - } -} - =item $c->run =cut