From 5e95c48e285b7125a305f08cf4fd76064134ed74 Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Thu, 14 Jul 2011 17:48:41 +0000 Subject: [PATCH] Use the context's response for header() calls in checkMaxLag() --- includes/Wiki.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/Wiki.php b/includes/Wiki.php index 4c99a72792..412fcd6ad1 100644 --- a/includes/Wiki.php +++ b/includes/Wiki.php @@ -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 { -- 2.20.1