* Return correct content-type header with 304 responses for StreamFile; it confuses...
authorBrion Vibber <brion@users.mediawiki.org>
Tue, 13 Jun 2006 23:54:08 +0000 (23:54 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Tue, 13 Jun 2006 23:54:08 +0000 (23:54 +0000)
RELEASE-NOTES
includes/StreamFile.php

index 0b003da..688c9e1 100644 (file)
@@ -489,6 +489,8 @@ Some default configuration options have changed:
 * (bug 2700) Nice things like link completion and signatures now work in <gallery> tags.
 * Cancel output buffering in StreamFile; when used inside gzip buffering this
   could cause funny timeout behavior as the Content-Length was wrong.
+* Return correct content-type header with 304 responses for StreamFile;
+  it confuses Safari if you let it return "text/html".
 
 
 == Compatibility ==
index 4b659de..8c3b537 100644 (file)
@@ -24,6 +24,13 @@ does not.</p>
                }
        }
        
+       $type = wfGetType( $fname );
+       if ( $type and $type!="unknown/unknown") {
+               header("Content-type: $type");
+       } else {
+               header('Content-type: application/x-wiki');
+       }
+
        if ( !empty( $_SERVER['HTTP_IF_MODIFIED_SINCE'] ) ) {
                $modsince = preg_replace( '/;.*$/', '', $_SERVER['HTTP_IF_MODIFIED_SINCE'] );
                $sinceTime = strtotime( $modsince );
@@ -35,13 +42,6 @@ does not.</p>
 
        header( 'Content-Length: ' . $stat['size'] );
 
-       $type = wfGetType( $fname );
-       if ( $type and $type!="unknown/unknown") {
-               header("Content-type: $type");
-       } else {
-               header('Content-type: application/x-wiki');
-       }
-
        readfile( $fname );
 }