Add Content-Length header to thumb.php error responses

Without the Content-Length header, the response is sent with Transfer-Encoding:
Chunked, which is somehow mangled by mod_fastcgi. Varnish then claims the
response is malformed and declines to process it, sending the client a 503
instead.

Change-Id: I977387bf3e039926df58e3e5a14d0d0bd55201c4
This commit is contained in:
Ori Livneh 2015-07-06 13:49:45 -07:00 committed by Ori.livneh
parent de25144a0b
commit 0ee9e717f4

View file

@ -570,7 +570,7 @@ function wfThumbError( $status, $msg ) {
} else {
$debug = '';
}
echo <<<EOT
$content = <<<EOT
<!DOCTYPE html>
<html><head>
<meta charset="UTF-8" />
@ -586,4 +586,6 @@ $debug
</html>
EOT;
header( 'Content-Length: ' . strlen( $content ) );
echo $content;
}