From 0ee9e717f49b9e15bd63fd66f3d0967939c35b05 Mon Sep 17 00:00:00 2001 From: Ori Livneh Date: Mon, 6 Jul 2015 13:49:45 -0700 Subject: [PATCH] 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 --- thumb.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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; } -- 2.20.1