r98757 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98756‎ | r98757 | r98758 >
Date:13:20, 3 October 2011
Author:catrope
Status:old
Tags:
Comment:
1.17wmf1: MFT r98755
Modified paths:
  • /branches/wmf/1.17wmf1/includes/DefaultSettings.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/Feed.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/OutputPage.php (modified) (history)
  • /branches/wmf/1.17wmf1/includes/api/ApiMain.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.17wmf1/includes/Feed.php
@@ -222,13 +222,13 @@
223223 * but can also be called separately.
224224 */
225225 public function httpHeaders() {
226 - global $wgOut, $wgVaryOnXFPForAPI;
 226+ global $wgOut, $wgVaryOnXFP;
227227
228228 # We take over from $wgOut, excepting its cache header info
229229 $wgOut->disable();
230230 $mimetype = $this->contentType();
231231 header( "Content-type: $mimetype; charset=UTF-8" );
232 - if ( $wgVaryOnXFPForAPI ) {
 232+ if ( $wgVaryOnXFP ) {
233233 $wgOut->addVaryHeader( 'X-Forwarded-Proto' );
234234 }
235235 $wgOut->sendCacheControl();
Index: branches/wmf/1.17wmf1/includes/OutputPage.php
@@ -1642,7 +1642,7 @@
16431643 */
16441644 public function output() {
16451645 global $wgUser, $wgOutputEncoding, $wgRequest;
1646 - global $wgLanguageCode, $wgDebugRedirects, $wgMimeType;
 1646+ global $wgLanguageCode, $wgDebugRedirects, $wgMimeType, $wgVaryOnXFP;
16471647 global $wgUseAjax, $wgAjaxWatch;
16481648 global $wgEnableMWSuggest, $wgUniversalEditButton;
16491649 global $wgArticle;
@@ -1661,6 +1661,9 @@
16621662 }
16631663 $this->mLastModified = wfTimestamp( TS_RFC2822 );
16641664 }
 1665+ if ( $wgVaryOnXFP ) {
 1666+ $this->addVaryHeader( 'X-Forwarded-Proto' );
 1667+ }
16651668 $this->sendCacheControl();
16661669
16671670 $wgRequest->response()->header( "Content-Type: text/html; charset=utf-8" );
Property changes on: branches/wmf/1.17wmf1/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
16681671 Merged /trunk/phase3/includes/OutputPage.php:r98755
Index: branches/wmf/1.17wmf1/includes/api/ApiMain.php
@@ -381,17 +381,17 @@
382382 }
383383
384384 protected function sendCacheHeaders() {
385 - global $wgUseXVO, $wgOut, $wgVaryOnXFPForAPI;
 385+ global $wgUseXVO, $wgOut, $wgVaryOnXFP;
386386 if ( $this->mCacheMode == 'private' ) {
387387 header( 'Cache-Control: private' );
388388 return;
389389 }
390390
391391 if ( $this->mCacheMode == 'anon-public-user-private' ) {
392 - $xfp = $wgVaryOnXFPForAPI ? ', X-Forwarded-Proto' : '';
 392+ $xfp = $wgVaryOnXFP ? ', X-Forwarded-Proto' : '';
393393 header( 'Vary: Accept-Encoding, Cookie' . $xfp );
394394 if ( $wgUseXVO ) {
395 - if ( $wgVaryOnXFPForAPI ) {
 395+ if ( $wgVaryOnXFP ) {
396396 $wgOut->addVaryHeader( 'X-Forwarded-Proto' );
397397 }
398398 header( $wgOut->getXVO() );
@@ -410,7 +410,7 @@
411411 }
412412
413413 // Send public headers
414 - if ( $wgVaryOnXFPForAPI ) {
 414+ if ( $wgVaryOnXFP ) {
415415 header( 'Vary: Accept-Encoding, X-Forwarded-Proto' );
416416 if ( $wgUseXVO ) {
417417 // Bleeeeegh. Our header setting system sucks
Index: branches/wmf/1.17wmf1/includes/DefaultSettings.php
@@ -1767,10 +1767,12 @@
17681768
17691769 /** Add X-Forwarded-Proto to the Vary and X-Vary-Options headers for API
17701770 * requests and RSS/Atom feeds. Use this if you have an SSL termination setup
1771 - * and need to split the cache between HTTP and HTTPS for API and feed requests
1772 - * in order to prevent cache pollution. This does not affect 'normal' requests.
 1771+ * and need to split the cache between HTTP and HTTPS for API requests,
 1772+ * feed requests and HTTP redirect responses in order to prevent cache
 1773+ * pollution. This does not affect 'normal' requests to index.php other than
 1774+ * HTTP redirects.
17731775 */
1774 -$wgVaryOnXFPForAPI = false;
 1776+$wgVaryOnXFP = false;
17751777
17761778 /**
17771779 * Internal server name as known to Squid, if different. Example:
Property changes on: branches/wmf/1.17wmf1/includes/DefaultSettings.php
___________________________________________________________________
Modified: svn:mergeinfo
17781780 Merged /trunk/phase3/includes/DefaultSettings.php:r98755

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r98755Rename $wgVaryOnXFPForAPI (introduced in r93818) to $wgVaryOnXFP and extend i...catrope13:15, 3 October 2011

Status & tagging log