[Jifty-commit] r1043 - in jifty/trunk: lib/Jifty/View/Static

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Sat May 13 16:33:11 EDT 2006


Author: trs
Date: Sat May 13 16:33:10 2006
New Revision: 1043

Modified:
   jifty/trunk/   (props changed)
   jifty/trunk/lib/Jifty/View/Static/Handler.pm

Log:
 r12265 at zot:  tom | 2006-05-13 16:32:56 -0400
 Allow for MIME types to be overridden.  The included override is needed because Opera chokes with ajax-fetched JS otherwise.


Modified: jifty/trunk/lib/Jifty/View/Static/Handler.pm
==============================================================================
--- jifty/trunk/lib/Jifty/View/Static/Handler.pm	(original)
+++ jifty/trunk/lib/Jifty/View/Static/Handler.pm	Sat May 13 16:33:10 2006
@@ -135,6 +135,14 @@
     my $self       = shift;
     my $local_path = shift;
 
+    # The key is the file extension, the value is the MIME type to send.
+    my %type_override = (
+        'js' => 'application/x-javascript',
+    );
+
+    return ($type_override{$1})
+        if $local_path =~ /\.(.+)$/ and defined $type_override{$1};
+
     my $mimeobj   = $mime->mimeTypeOf($local_path);
     my $mime_type = (
           $mimeobj


More information about the Jifty-commit mailing list