X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=509585f218c4dcdc9814e0fa67ae24484945a2ea;hp=7ba4167b4c4ff6415f694839dc08f015b079e34d;hb=671123ba662cd4d38ee2590baad2b9f46947cb4e;hpb=4b66aa190dcbe36875bf25a610648ab3744ced4b diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 7ba4167..509585f 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -311,6 +311,8 @@ Clean up after uploads, deleting temp files. sub finalize_uploads { my ( $self, $c ) = @_; + # N.B. This code is theoretically entirely unneeded due to ->cleanup(1) + # on the HTTP::Body object. my $request = $c->request; foreach my $key (keys %{ $request->uploads }) { my $upload = $request->uploads->{$key}; @@ -335,6 +337,7 @@ sub prepare_body { unless ( $request->_body ) { my $type = $request->header('Content-Type'); $request->_body(HTTP::Body->new( $type, $length )); + $request->_body->cleanup(1); # Make extra sure! $request->_body->tmpdir( $appclass->config->{uploadtmp} ) if exists $appclass->config->{uploadtmp}; } @@ -543,7 +546,7 @@ sub prepare_uploads { my $u = Catalyst::Request::Upload->new ( size => $upload->{size}, - type => $headers->content_type, + type => scalar $headers->content_type, headers => $headers, tempname => $upload->{tempname}, filename => $upload->{filename}, @@ -705,13 +708,13 @@ sub unescape_uri { =head2 $self->env -Hash containing enviroment variables including many special variables inserted +Hash containing environment variables including many special variables inserted by WWW server - like SERVER_*, REMOTE_*, HTTP_* ... -Before accesing enviroment variables consider whether the same information is +Before accessing environment variables consider whether the same information is not directly available via Catalyst objects $c->request, $c->engine ... -BEWARE: If you really need to access some enviroment variable from your Catalyst +BEWARE: If you really need to access some environment variable from your Catalyst application you should use $c->engine->env->{VARNAME} instead of $ENV{VARNAME}, as in some enviroments the %ENV hash does not contain what you would expect.