X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst.pm;h=61148f3b748591f75dd6384dcf56b08c0993b9d1;hb=7fee060fe57305509098afada9d7957fe783c245;hp=ff4ad244f839d06c1486c425dad9bff2d8f22532;hpb=7cee84a9da0fc31861e2f81d333be5dac73e15d5;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index ff4ad24..61148f3 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -180,7 +180,7 @@ sub composed_stats_class { __PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90092'; +our $VERSION = '5.90099_001'; $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases sub import { @@ -2228,9 +2228,10 @@ sub finalize_encoding { # Set the charset if necessary. This might be a bit bonkers since encodable response # is false when the set charset is not the same as the encoding mimetype (maybe # confusing action at a distance here.. - # Don't try to set the charset if one already exists + # Don't try to set the charset if one already exists or if headers are already finalized $c->res->content_type($c->res->content_type . "; charset=" . $c->encoding->mime_name) - unless($c->res->content_type_charset); + unless($c->res->content_type_charset || + ($c->res->_context && $c->res->finalized_headers && !$c->res->_has_response_cb)); } } @@ -2919,7 +2920,7 @@ sub setup_components { my @injected = $class->setup_injected_components; # All components are registered, now we need to 'init' them. - foreach my $component_name (@injected, @comps) { + foreach my $component_name (@comps, @injected) { $class->components->{$component_name} = $class->components->{$component_name}->() if (ref($class->components->{$component_name}) || '') eq 'CODE'; }