[Catalyst-commits] r11597 -
Catalyst-Plugin-Session-State-URI/trunk/lib/Catalyst/Plugin/Session/State
joel at dev.catalyst.perl.org
joel at dev.catalyst.perl.org
Sat Oct 17 17:06:07 GMT 2009
Author: joel
Date: 2009-10-17 17:06:06 +0000 (Sat, 17 Oct 2009)
New Revision: 11597
Modified:
Catalyst-Plugin-Session-State-URI/trunk/lib/Catalyst/Plugin/Session/State/URI.pm
Log:
Fixed heinous accident waiting to happen and simplified code slightly
Modified: Catalyst-Plugin-Session-State-URI/trunk/lib/Catalyst/Plugin/Session/State/URI.pm
===================================================================
--- Catalyst-Plugin-Session-State-URI/trunk/lib/Catalyst/Plugin/Session/State/URI.pm 2009-10-17 16:51:11 UTC (rev 11596)
+++ Catalyst-Plugin-Session-State-URI/trunk/lib/Catalyst/Plugin/Session/State/URI.pm 2009-10-17 17:06:06 UTC (rev 11597)
@@ -304,12 +304,9 @@
my ( $c, $uri ) = @_;
# ignore media type such as gif, pdf and etc
- if ( $uri->path =~ m#\.(\w+)(?:\?|$)# ) {
- my $mt = new MIME::Types->mimeTypeOf($1);
-
- if ( ref $mt ) {
- return if $mt->isBinary;
- }
+ if ( my ($ext) = $uri->path =~ m#\.(\w+)(?:\?|$)# ) {
+ my $mt = MIME::Types->new->mimeTypeOf($ext);
+ return if ref $mt && $mt->isBinary;
}
return 1;
More information about the Catalyst-commits
mailing list