Add a header on thumb.php saying which thumb server on error.
authorBrian Wolff <bawolff+wn@gmail.com>
Sat, 28 Sep 2013 23:41:00 +0000 (20:41 -0300)
committerBrian Wolff <bawolff+wn@gmail.com>
Sat, 28 Sep 2013 23:41:00 +0000 (20:41 -0300)
Only added if $wgShowHostnames is on. Adding the host name as a
header makes it much easier when debugging with command line tools,
since one often throws away the response body. This still keeps
the host name in an html comment in the response body as well,
like it was previously.

Change-Id: I9d15bd5e2abb4e7a8d3fe2a17fc546a1c5f3b70f

thumb.php

index 2cda344..d2976f2 100644 (file)
--- a/thumb.php
+++ b/thumb.php
@@ -387,6 +387,7 @@ function wfThumbError( $status, $msg ) {
                header( 'HTTP/1.1 500 Internal server error' );
        }
        if ( $wgShowHostnames ) {
+               header( 'X-MW-Thumbnail-Renderer: ' . wfHostname() );
                $url = htmlspecialchars( isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '' );
                $hostname = htmlspecialchars( wfHostname() );
                $debug = "<!-- $url -->\n<!-- $hostname -->\n";