Index: trunk/phase3/includes/Feed.php |
— | — | @@ -239,13 +239,13 @@ |
240 | 240 | * but can also be called separately. |
241 | 241 | */ |
242 | 242 | public function httpHeaders() { |
243 | | - global $wgOut, $wgVaryOnXFPForAPI; |
| 243 | + global $wgOut, $wgVaryOnXFP; |
244 | 244 | |
245 | 245 | # We take over from $wgOut, excepting its cache header info |
246 | 246 | $wgOut->disable(); |
247 | 247 | $mimetype = $this->contentType(); |
248 | 248 | header( "Content-type: $mimetype; charset=UTF-8" ); |
249 | | - if ( $wgVaryOnXFPForAPI ) { |
| 249 | + if ( $wgVaryOnXFP ) { |
250 | 250 | $wgOut->addVaryHeader( 'X-Forwarded-Proto' ); |
251 | 251 | } |
252 | 252 | $wgOut->sendCacheControl(); |
Index: trunk/phase3/includes/OutputPage.php |
— | — | @@ -1806,7 +1806,7 @@ |
1807 | 1807 | * the object, let's actually output it: |
1808 | 1808 | */ |
1809 | 1809 | public function output() { |
1810 | | - global $wgLanguageCode, $wgDebugRedirects, $wgMimeType; |
| 1810 | + global $wgLanguageCode, $wgDebugRedirects, $wgMimeType, $wgVaryOnXFP; |
1811 | 1811 | |
1812 | 1812 | if( $this->mDoNothing ) { |
1813 | 1813 | return; |
— | — | @@ -1826,6 +1826,9 @@ |
1827 | 1827 | } |
1828 | 1828 | $this->mLastModified = wfTimestamp( TS_RFC2822 ); |
1829 | 1829 | } |
| 1830 | + if ( $wgVaryOnXFP ) { |
| 1831 | + $this->addVaryHeader( 'X-Forwarded-Proto' ); |
| 1832 | + } |
1830 | 1833 | $this->sendCacheControl(); |
1831 | 1834 | |
1832 | 1835 | $response->header( "Content-Type: text/html; charset=utf-8" ); |
Index: trunk/phase3/includes/api/ApiMain.php |
— | — | @@ -399,7 +399,7 @@ |
400 | 400 | } |
401 | 401 | |
402 | 402 | protected function sendCacheHeaders() { |
403 | | - global $wgUseXVO, $wgOut, $wgVaryOnXFPForAPI; |
| 403 | + global $wgUseXVO, $wgOut, $wgVaryOnXFP; |
404 | 404 | $response = $this->getRequest()->response(); |
405 | 405 | |
406 | 406 | if ( $this->mCacheMode == 'private' ) { |
— | — | @@ -408,10 +408,10 @@ |
409 | 409 | } |
410 | 410 | |
411 | 411 | if ( $this->mCacheMode == 'anon-public-user-private' ) { |
412 | | - $xfp = $wgVaryOnXFPForAPI ? ', X-Forwarded-Proto' : ''; |
| 412 | + $xfp = $wgVaryOnXFP ? ', X-Forwarded-Proto' : ''; |
413 | 413 | $response->header( 'Vary: Accept-Encoding, Cookie' . $xfp ); |
414 | 414 | if ( $wgUseXVO ) { |
415 | | - if ( $wgVaryOnXFPForAPI ) { |
| 415 | + if ( $wgVaryOnXFP ) { |
416 | 416 | $wgOut->addVaryHeader( 'X-Forwarded-Proto' ); |
417 | 417 | } |
418 | 418 | $response->header( $wgOut->getXVO() ); |
— | — | @@ -430,7 +430,7 @@ |
431 | 431 | } |
432 | 432 | |
433 | 433 | // Send public headers |
434 | | - if ( $wgVaryOnXFPForAPI ) { |
| 434 | + if ( $wgVaryOnXFP ) { |
435 | 435 | $response->header( 'Vary: Accept-Encoding, X-Forwarded-Proto' ); |
436 | 436 | if ( $wgUseXVO ) { |
437 | 437 | // Bleeeeegh. Our header setting system sucks |
Index: trunk/phase3/includes/DefaultSettings.php |
— | — | @@ -1754,10 +1754,12 @@ |
1755 | 1755 | |
1756 | 1756 | /** Add X-Forwarded-Proto to the Vary and X-Vary-Options headers for API |
1757 | 1757 | * requests and RSS/Atom feeds. Use this if you have an SSL termination setup |
1758 | | - * and need to split the cache between HTTP and HTTPS for API and feed requests |
1759 | | - * in order to prevent cache pollution. This does not affect 'normal' requests. |
| 1758 | + * and need to split the cache between HTTP and HTTPS for API requests, |
| 1759 | + * feed requests and HTTP redirect responses in order to prevent cache |
| 1760 | + * pollution. This does not affect 'normal' requests to index.php other than |
| 1761 | + * HTTP redirects. |
1760 | 1762 | */ |
1761 | | -$wgVaryOnXFPForAPI = false; |
| 1763 | +$wgVaryOnXFP = false; |
1762 | 1764 | |
1763 | 1765 | /** |
1764 | 1766 | * Internal server name as known to Squid, if different. Example: |