r98758 MediaWiki - Code Review archive

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

Diff [purge]

Index: branches/wmf/1.18wmf1/includes/Feed.php
@@ -239,13 +239,13 @@
240240 * but can also be called separately.
241241 */
242242 public function httpHeaders() {
243 - global $wgOut, $wgVaryOnXFPForAPI;
 243+ global $wgOut, $wgVaryOnXFP;
244244
245245 # We take over from $wgOut, excepting its cache header info
246246 $wgOut->disable();
247247 $mimetype = $this->contentType();
248248 header( "Content-type: $mimetype; charset=UTF-8" );
249 - if ( $wgVaryOnXFPForAPI ) {
 249+ if ( $wgVaryOnXFP ) {
250250 $wgOut->addVaryHeader( 'X-Forwarded-Proto' );
251251 }
252252 $wgOut->sendCacheControl();
Index: branches/wmf/1.18wmf1/includes/OutputPage.php
@@ -1785,7 +1785,7 @@
17861786 * the object, let's actually output it:
17871787 */
17881788 public function output() {
1789 - global $wgLanguageCode, $wgDebugRedirects, $wgMimeType;
 1789+ global $wgLanguageCode, $wgDebugRedirects, $wgMimeType, $wgVaryOnXFP;
17901790
17911791 if( $this->mDoNothing ) {
17921792 return;
@@ -1805,6 +1805,9 @@
18061806 }
18071807 $this->mLastModified = wfTimestamp( TS_RFC2822 );
18081808 }
 1809+ if ( $wgVaryOnXFP ) {
 1810+ $this->addVaryHeader( 'X-Forwarded-Proto' );
 1811+ }
18091812 $this->sendCacheControl();
18101813
18111814 $response->header( "Content-Type: text/html; charset=utf-8" );
Property changes on: branches/wmf/1.18wmf1/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
18121815 Merged /trunk/phase3/includes/OutputPage.php:r98755
Index: branches/wmf/1.18wmf1/includes/api/ApiMain.php
@@ -399,7 +399,7 @@
400400 }
401401
402402 protected function sendCacheHeaders() {
403 - global $wgUseXVO, $wgOut, $wgVaryOnXFPForAPI;
 403+ global $wgUseXVO, $wgOut, $wgVaryOnXFP;
404404 $response = $this->getRequest()->response();
405405
406406 if ( $this->mCacheMode == 'private' ) {
@@ -408,10 +408,10 @@
409409 }
410410
411411 if ( $this->mCacheMode == 'anon-public-user-private' ) {
412 - $xfp = $wgVaryOnXFPForAPI ? ', X-Forwarded-Proto' : '';
 412+ $xfp = $wgVaryOnXFP ? ', X-Forwarded-Proto' : '';
413413 $response->header( 'Vary: Accept-Encoding, Cookie' . $xfp );
414414 if ( $wgUseXVO ) {
415 - if ( $wgVaryOnXFPForAPI ) {
 415+ if ( $wgVaryOnXFP ) {
416416 $wgOut->addVaryHeader( 'X-Forwarded-Proto' );
417417 }
418418 $response->header( $wgOut->getXVO() );
@@ -430,7 +430,7 @@
431431 }
432432
433433 // Send public headers
434 - if ( $wgVaryOnXFPForAPI ) {
 434+ if ( $wgVaryOnXFP ) {
435435 $response->header( 'Vary: Accept-Encoding, X-Forwarded-Proto' );
436436 if ( $wgUseXVO ) {
437437 // Bleeeeegh. Our header setting system sucks
Index: branches/wmf/1.18wmf1/includes/DefaultSettings.php
@@ -1743,10 +1743,12 @@
17441744
17451745 /** Add X-Forwarded-Proto to the Vary and X-Vary-Options headers for API
17461746 * requests and RSS/Atom feeds. Use this if you have an SSL termination setup
1747 - * and need to split the cache between HTTP and HTTPS for API and feed requests
1748 - * in order to prevent cache pollution. This does not affect 'normal' requests.
 1747+ * and need to split the cache between HTTP and HTTPS for API requests,
 1748+ * feed requests and HTTP redirect responses in order to prevent cache
 1749+ * pollution. This does not affect 'normal' requests to index.php other than
 1750+ * HTTP redirects.
17491751 */
1750 -$wgVaryOnXFPForAPI = false;
 1752+$wgVaryOnXFP = false;
17511753
17521754 /**
17531755 * Internal server name as known to Squid, if different. Example:

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