Add Content-Length header to thumb.php redirects
authorGiuseppe Lavagetto <glavagetto@wikimedia.org>
Wed, 29 Jul 2015 10:12:55 +0000 (12:12 +0200)
committerAlex Monk <krenair@gmail.com>
Wed, 29 Jul 2015 15:57:45 +0000 (16:57 +0100)
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.

This is a followup of 0ee9e717f49b9e15bd63fd66f3d0967939c35b05

Bug: T84842
Change-Id: Ia610a43789e6ff14cfc0964f285bbec39c890152

thumb.php

index 3b7ff43..03a3f35 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -213,6 +213,7 @@ function wfStreamThumb( array $params ) {
                        if ( count( $varyHeader ) ) {
                                $response->header( 'Vary: ' . implode( ', ', $varyHeader ) );
                        }
+                       $response->header( 'Content-Length: 0' );
                        return;
                }