From: Brion Vibber Date: Tue, 13 Jun 2006 23:54:08 +0000 (+0000) Subject: * Return correct content-type header with 304 responses for StreamFile; it confuses... X-Git-Tag: 1.31.0-rc.0~56787 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/pie.php?a=commitdiff_plain;h=b57ed467998c7331931223c48a9239204661ba0a;p=lhc%2Fweb%2Fwiklou.git * Return correct content-type header with 304 responses for StreamFile; it confuses Safari if you let it return "text/html". --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 0b003da7f9..688c9e12bb 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -489,6 +489,8 @@ Some default configuration options have changed: * (bug 2700) Nice things like link completion and signatures now work in 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 == diff --git a/includes/StreamFile.php b/includes/StreamFile.php index 4b659deac2..8c3b5372a7 100644 --- a/includes/StreamFile.php +++ b/includes/StreamFile.php @@ -24,6 +24,13 @@ does not.

} } + $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.

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 ); }