From: Aaron Schulz Date: Thu, 20 Sep 2012 04:18:19 +0000 (-0700) Subject: Don't send empty Vary headers. X-Git-Tag: 1.31.0-rc.0~22329 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/?a=commitdiff_plain;h=94158d6387b466910aebe60c3eb3fd3d00d1a0e9;p=lhc%2Fweb%2Fwiklou.git Don't send empty Vary headers. Change-Id: I0b6bd7ab24323782302c28cf1438dce62f5b8c5a --- diff --git a/thumb.php b/thumb.php index cba44a9114..9b21ab3f8f 100644 --- a/thumb.php +++ b/thumb.php @@ -237,7 +237,9 @@ function wfStreamThumb( array $params ) { if ( $wgVaryOnXFP ) { $varyHeader[] = 'X-Forwarded-Proto'; } - $response->header( 'Vary: ' . implode( ', ', $varyHeader ) ); + if ( count( $varyHeader ) ) { + $response->header( 'Vary: ' . implode( ', ', $varyHeader ) ); + } wfProfileOut( __METHOD__ ); return; } else { @@ -248,7 +250,9 @@ function wfStreamThumb( array $params ) { } $thumbPath = $img->getThumbPath( $thumbName ); if ( $img->getRepo()->fileExists( $thumbPath ) ) { - $headers[] = 'Vary: ' . implode( ', ', $varyHeader ); + if ( count( $varyHeader ) ) { + $headers[] = 'Vary: ' . implode( ', ', $varyHeader ); + } $img->getRepo()->streamFile( $thumbPath, $headers ); wfProfileOut( __METHOD__ ); return; @@ -258,7 +262,10 @@ function wfStreamThumb( array $params ) { wfProfileOut( __METHOD__ ); return; } - $headers[] = 'Vary: ' . implode( ', ', $varyHeader ); + + if ( count( $varyHeader ) ) { + $headers[] = 'Vary: ' . implode( ', ', $varyHeader ); + } // Thumbnail isn't already there, so create the new thumbnail... try {