From dff6f25d5ddd3d4147a3c6a478359729b5ca0282 Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Tue, 8 Nov 2011 16:06:59 +0000 Subject: [PATCH] Use the local context instead of $wgOut, now that we have one --- includes/api/ApiMain.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/includes/api/ApiMain.php b/includes/api/ApiMain.php index 880d884987..ebfa836ab3 100644 --- a/includes/api/ApiMain.php +++ b/includes/api/ApiMain.php @@ -404,7 +404,7 @@ class ApiMain extends ApiBase { } protected function sendCacheHeaders() { - global $wgUseXVO, $wgOut, $wgVaryOnXFP; + global $wgUseXVO, $wgVaryOnXFP; $response = $this->getRequest()->response(); if ( $this->mCacheMode == 'private' ) { @@ -416,11 +416,12 @@ class ApiMain extends ApiBase { $xfp = $wgVaryOnXFP ? ', X-Forwarded-Proto' : ''; $response->header( 'Vary: Accept-Encoding, Cookie' . $xfp ); if ( $wgUseXVO ) { + $out = $this->getOutput(); if ( $wgVaryOnXFP ) { - $wgOut->addVaryHeader( 'X-Forwarded-Proto' ); + $out->addVaryHeader( 'X-Forwarded-Proto' ); } - $response->header( $wgOut->getXVO() ); - if ( $wgOut->haveCacheVaryCookies() ) { + $response->header( $out->getXVO() ); + if ( $out->haveCacheVaryCookies() ) { // Logged in, mark this request private $response->header( 'Cache-Control: private' ); return; -- 2.20.1