Skip Menu |

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

Report information
The Basics
Id: 75236
Status: open
Priority: 0/
Queue: Catalyst-Plugin-Compress

People
Owner: Nobody in particular
Requestors: thijs.oppermann [...] tty.nl
Cc:
AdminCc:

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



Subject: Problem with using Catalyst::Plugin::Unicode::Encoding and Catalyst::Plugin::Compress together
Date: Thu, 23 Feb 2012 11:01:49 +0100
To: bug-Catalyst-Plugin-Compress [...] rt.cpan.org, bug-Catalyst-Plugin-Unicode-Encoding [...] rt.cpan.org
From: Thijs Oppermann <thijs.oppermann [...] tty.nl>
First of all, Catalyst::Plugin::Compress tells me how I should use it with Catalyst::Plugin::Unicode, but Catalyst::Plugin::Unicode tells me it's deprecated in favor of Catalyst::Plugin::Unicode::Encoding. So maybe this link in the POD can be corrected to point to Catalyst::Plugin::Unicode::Encoding. However, using these two together (Catalyst::Plugin::Unicode::Encoding and Catalyst::Plugin::Compress) doesn't work. I get a 'Content Encoding Error' in my browser and a 'Wide character in memGzip' exception in my apache log. Changing the order in with I 'use' them doesn't help. I think the problem is that Catalyst::Plugin::Compress hooks into 'finalize', while Catalyst::Plugin::Unicode::Encoding hooks into 'finalize_headers'. This means that Catalyst::Plugin::Unicode::Encoding will always run *after* Catalyst::Plugin::Compress (I think?), which is of course exactly what you *don't* want. I've written my own Compress plugin that hooks into 'finalize_headers' and that does work. I'm not sure that that's the correct place, though, so maybe the solution should be to hook Catalyst::Plugin::Unicode::Encoding into 'finalize' instead. Thijs
From: rod.taylor [...] gmail.com
On Thu Feb 23 05:02:05 2012, thijs.oppermann@tty.nl wrote: Show quoted text
> First of all, Catalyst::Plugin::Compress tells me how I should use it > with Catalyst::Plugin::Unicode, but Catalyst::Plugin::Unicode tells me > it's deprecated in favor of Catalyst::Plugin::Unicode::Encoding. > > So maybe this link in the POD can be corrected to point to > Catalyst::Plugin::Unicode::Encoding. > > However, using these two together (Catalyst::Plugin::Unicode::Encoding > and Catalyst::Plugin::Compress) doesn't work. I get a 'Content Encoding > Error' in my browser and a 'Wide character in memGzip' exception in my > apache log. > > Changing the order in with I 'use' them doesn't help. > > I think the problem is that Catalyst::Plugin::Compress hooks into > 'finalize', while Catalyst::Plugin::Unicode::Encoding hooks into > 'finalize_headers'. This means that Catalyst::Plugin::Unicode::Encoding > will always run *after* Catalyst::Plugin::Compress (I think?), which is > of course exactly what you *don't* want.
I didn't receive the wide character warning, but I can confirm that using 'finalize' gives garbled output (Browsers say the GZip is invalid) and using 'finalize_headers' gives expected output. I discovered this independently and found this open ticket when I went to report the issue.