http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72359

Revision: 72359
Author:   tparscal
Date:     2010-09-04 08:38:45 +0000 (Sat, 04 Sep 2010)

Log Message:
-----------
Fix a bug in the resource loader causing it to return no Content-Type header 
for 304s. Firefox doesn't care but Chrome seems to, so we always set the right 
Content-Type

Modified Paths:
--------------
    trunk/phase3/includes/ResourceLoader.php

Modified: trunk/phase3/includes/ResourceLoader.php
===================================================================
--- trunk/phase3/includes/ResourceLoader.php    2010-09-04 08:32:48 UTC (rev 
72358)
+++ trunk/phase3/includes/ResourceLoader.php    2010-09-04 08:38:45 UTC (rev 
72359)
@@ -254,6 +254,13 @@
                        $maxage = min( $maxage, 
self::$modules[$name]->getClientMaxage() );
                        $smaxage = min( $smaxage, 
self::$modules[$name]->getServerMaxage() );
                }
+               
+               // Output headers
+               if ( $context->getOnly() === 'styles' ) {
+                       header( 'Content-Type: text/css' );
+               } else {
+                       header( 'Content-Type: text/javascript' );
+               }
                header( 'Last-Modified: ' . wfTimestamp( TS_RFC2822, $mtime ) );
                $expires = wfTimestamp( TS_RFC2822, min( $maxage, $smaxage ) + 
time() );
                header( "Cache-Control: public, maxage=$maxage, 
s-maxage=$smaxage" );
@@ -322,10 +329,7 @@
                        }
                }
                // Output the appropriate header
-               if ( $context->getOnly() === 'styles' ) {
-                       header( 'Content-Type: text/css' );
-               } else {
-                       header( 'Content-Type: text/javascript' );
+               if ( $context->getOnly() !== 'styles' ) {
                        if ( $context->getDebug() ) {
                                ob_end_flush();
                        } else {



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to