}
/**
- * T23672: Add Accept-Language to Vary and Key headers if there's no 'variant' parameter in GET.
+ * T23672: Add Accept-Language to Vary header if there's no 'variant' parameter in GET.
*
* For example:
* /w/index.php?title=Main_page will vary based on Accept-Language; but
$headers = [];
foreach ( $this->getProviders() as $provider ) {
foreach ( $provider->getVaryHeaders() as $header => $options ) {
- if ( !isset( $headers[$header] ) ) {
- $headers[$header] = [];
- }
- if ( is_array( $options ) ) {
- $headers[$header] = array_unique( array_merge( $headers[$header], $options ) );
- }
+ # Note that the $options value returned has been deprecated
+ # and is ignored.
+ $headers[$header] = null;
}
}
$this->varyHeaders = $headers;
* }
* @endcode
*
+ * Note that the $options argument to OutputPage::addVaryHeader() has
+ * been deprecated and should always be null.
+ *
* @return array
*/
public function getVaryHeaders();
* @param array[] $calls For each array, call addVaryHeader() with those arguments
* @param string[] $cookies Array of cookie names to vary on
* @param string $vary Text of expected Vary header (including the 'Vary: ')
- * @param string $key Text of expected Key header (including the 'Key: ')
*/
public function testVaryHeaders( array $calls, array $cookies, $vary ) {
// Get rid of default Vary fields
] );
$expect = [
- 'Foo' => [],
- 'Bar' => [ 'X', 'Bar1', 3 => 'Bar2' ],
- 'Quux' => [ 'Quux' ],
- 'Baz' => [],
+ 'Foo' => null,
+ 'Bar' => null,
+ 'Quux' => null,
+ 'Baz' => null,
];
$this->assertEquals( $expect, $manager->getVaryHeaders() );