properly non blocking streaming when running under a supporting server like
Twiggy. See Catalyst::Delta for more. This change might cause issues if
you are making heaving use of streaming (although in general we expect things
- to work much better.
+ to work much better.
+ - In the case when we remove a content body from the response because you set
+ an information status or a no content type status, warn that we are doing so
+ when in debug mode. You might see additional debugging information to help
+ you find and remove unneeded response bodies.
+ - Updated the code where Catalyst tries to guess a content length when you
+ fail to provide one. This should cause less issues when trying to guess the
+ length of a funky filehandle. This now uses Plack::Middleware::ContentLength
+ - Removed custom code to remove body content when the request is HEAD and
+ swapped it for Plack::Middleware::Head.
5.90059_001 - 2013-12-19
- Removed deprecated Regexp dispatch type from dependency list. If you are
use Plack::Middleware::IIS6ScriptNameFix;
use Plack::Middleware::IIS7KeepAliveFix;
use Plack::Middleware::LighttpdScriptNameFix;
+use Plack::Middleware::ContentLength;
+use Plack::Middleware::Head;
use Plack::Util;
use Class::Load 'load_class';
$c->finalize_headers unless $c->response->finalized_headers;
- # HEAD request
- if ( $c->request->method eq 'HEAD' ) {
- $c->response->body('');
- }
-
$c->finalize_body;
}
}
}
- # Content-Length
- if ( defined $response->body && length $response->body && !$response->content_length ) {
-
- # get the length from a filehandle
- if ( blessed( $response->body ) && $response->body->can('read') || ref( $response->body ) eq 'GLOB' )
- {
- my $size = -s $response->body;
- if ( $size ) {
- $response->content_length( $size );
- }
- else {
- $c->log->warn('Serving filehandle without a content-length');
- }
- }
- else {
- # everything should be bytes at this point, but just in case
- $response->content_length( length( $response->body ) );
- }
- }
-
# Remove incorrectly added body and content related meta data when returning
# an information response, or a response the is required to not include a body
sub registered_middlewares {
my $class = shift;
if(my $middleware = $class->_psgi_middleware) {
- return @$middleware;
+ return (
+ Plack::Middleware::ContentLength->new,
+ Plack::Middleware::Head->new,
+ @$middleware);
} else {
die "You cannot call ->registered_middlewares until middleware has been setup";
}
issue you can apply the middleware L<Plack::Middleware::BufferedStreaming>
or report specific problems to the dev team.
+Also, we have started migrating code in Catalyst to equivilent Plack
+Middleware when such exists and is correct to do so.
+
=head2 VERSION 5.9XXXX 'cataplack'
The Catalyst::Engine sub-classes have all been removed and deprecated,