Index: trunk/phase3/includes/ResourceLoader.php |
— | — | @@ -254,6 +254,13 @@ |
255 | 255 | $maxage = min( $maxage, self::$modules[$name]->getClientMaxage() ); |
256 | 256 | $smaxage = min( $smaxage, self::$modules[$name]->getServerMaxage() ); |
257 | 257 | } |
| 258 | + |
| 259 | + // Output headers |
| 260 | + if ( $context->getOnly() === 'styles' ) { |
| 261 | + header( 'Content-Type: text/css' ); |
| 262 | + } else { |
| 263 | + header( 'Content-Type: text/javascript' ); |
| 264 | + } |
258 | 265 | header( 'Last-Modified: ' . wfTimestamp( TS_RFC2822, $mtime ) ); |
259 | 266 | $expires = wfTimestamp( TS_RFC2822, min( $maxage, $smaxage ) + time() ); |
260 | 267 | header( "Cache-Control: public, maxage=$maxage, s-maxage=$smaxage" ); |
— | — | @@ -322,10 +329,7 @@ |
323 | 330 | } |
324 | 331 | } |
325 | 332 | // Output the appropriate header |
326 | | - if ( $context->getOnly() === 'styles' ) { |
327 | | - header( 'Content-Type: text/css' ); |
328 | | - } else { |
329 | | - header( 'Content-Type: text/javascript' ); |
| 333 | + if ( $context->getOnly() !== 'styles' ) { |
330 | 334 | if ( $context->getDebug() ) { |
331 | 335 | ob_end_flush(); |
332 | 336 | } else { |