X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FResponse.pm;h=0ef4c52ddf4ebe626a164e7d4ead178b5611c11f;hp=82677a7ce404b11a87e192446e5569bd0508f5f7;hb=12982f8623b4a3520146d4f52c5705d2b8a3b5ab;hpb=b063a165c4247e0312f19ed90829a0e7161fa449 diff --git a/lib/Catalyst/Response.pm b/lib/Catalyst/Response.pm index 82677a7..0ef4c52 100644 --- a/lib/Catalyst/Response.pm +++ b/lib/Catalyst/Response.pm @@ -55,7 +55,7 @@ has write_fh => ( sub _build_write_fh { my $writer = $_[0]->_writer; # We need to get the finalize headers side effect... - my $requires_encoding = $_[0]->content_type =~ m/^text|xml$|javascript$/; + my $requires_encoding = $_[0]->content_type =~ m/$Catalyst::DEFAULT_ENCODE_CONTENT_TYPE_MATCH/; my %fields = ( _writer => $writer, _encoding => $_[0]->encoding, @@ -118,7 +118,7 @@ sub write { $buffer = q[] unless defined $buffer; $buffer = $self->_context->encoding->encode( $buffer, $self->_context->_encode_check ) - if $self->_context->encoding && $self->content_type =~ /^text|xml$|javascript$/; + if $self->_context->encoding && $self->content_type =~ /$Catalyst::DEFAULT_ENCODE_CONTENT_TYPE_MATCH/; my $len = length($buffer); $self->_writer->write($buffer);