Use the context's response for header() calls in checkMaxLag()
authorChad Horohoe <demon@users.mediawiki.org>
Thu, 14 Jul 2011 17:48:41 +0000 (17:48 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Thu, 14 Jul 2011 17:48:41 +0000 (17:48 +0000)
includes/Wiki.php

index 4c99a72..412fcd6 100644 (file)
@@ -551,10 +551,11 @@ class MediaWiki {
                        list( $host, $lag ) = $lb->getMaxLag();
                        if ( $lag > $maxLag ) {
                                if ( $abort ) {
-                                       header( 'HTTP/1.1 503 Service Unavailable' );
-                                       header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
-                                       header( 'X-Database-Lag: ' . intval( $lag ) );
-                                       header( 'Content-Type: text/plain' );
+                                       $resp = $this->context->getRequest()->response();
+                                       $resp->header( 'HTTP/1.1 503 Service Unavailable' );
+                                       $resp->header( 'Retry-After: ' . max( intval( $maxLag ), 5 ) );
+                                       $resp->header( 'X-Database-Lag: ' . intval( $lag ) );
+                                       $resp->header( 'Content-Type: text/plain' );
                                        if( $wgShowHostnames ) {
                                                echo "Waiting for $host: $lag seconds lagged\n";
                                        } else {