From: Ori Livneh Date: Mon, 6 Jul 2015 20:49:45 +0000 (-0700) Subject: Add Content-Length header to thumb.php error responses X-Git-Tag: 1.31.0-rc.0~10857^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=0ee9e717f49b9e15bd63fd66f3d0967939c35b05;p=lhc%2Fweb%2Fwiklou.git 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 --- diff --git a/thumb.php b/thumb.php index c4e690e44c..b530bb586e 100644 --- a/thumb.php +++ b/thumb.php @@ -570,7 +570,7 @@ function wfThumbError( $status, $msg ) { } else { $debug = ''; } - echo << @@ -586,4 +586,6 @@ $debug EOT; + header( 'Content-Length: ' . strlen( $content ) ); + echo $content; }