Skip Menu |

This queue is for tickets about the Catalyst-Plugin-Compress CPAN distribution.

Report information
The Basics
Id: 46259
Status: resolved
Priority: 0/
Queue: Catalyst-Plugin-Compress

People
Owner: Nobody in particular
Requestors: aaron.barlow [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: Compression ignored for content type application/json
Catalyst::Plugin::Compress does not apply compression to json content. JSON content served through Catalyst::View::JSON has a content_type of 'application/json' for all browsers except Opera. The filter on line 76 needs to be updated to account for this content type. I've attached a patch that should allow JSON content to be compressed.
Subject: compress.patch
--- Catalyst-Plugin-Compress-0.002/lib/Catalyst/Plugin/Compress.pm 2009-04-20 09:38:59.000000000 -0600 +++ Catalyst-Plugin-Compress-0.003/lib/Catalyst/Plugin/Compress.pm 2009-05-20 15:24:45.000000000 -0600 @@ -73,7 +73,7 @@ or $c->res->content_encoding or (not $c->res->body) or ($c->res->status != 200) - or ($c->res->content_type !~ /^text|xml$|javascript$/) + or ($c->res->content_type !~ /^text|xml$|javascript|json$/) ) { return $c->maybe::next::method(@_); }
Fixed in catalyst repository r12741. Catalyst::Plugin::Compress 0.004 will have your patch applied.