jenkins-bot has submitted this change and it was merged.

Change subject: Hygiene: Update $wgMFMobileHeader default value
......................................................................


Hygiene: Update $wgMFMobileHeader default value

$wgMFMobileHeader was changed from X-WAP to X-Subdomain for all
mobile Wikipedias on 12th March 2014 <If519b3ec>.

Bug: T143891
Change-Id: I81774ed34c86fa607b5e8d4613af16a4b5f68f45
---
M README.md
M extension.json
M tests/phpunit/MobileContextTest.php
M tests/phpunit/devices/DeviceDetectorServiceIntegrationTest.php
4 files changed, 9 insertions(+), 12 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/README.md b/README.md
index 37cca1a..6439c3b 100644
--- a/README.md
+++ b/README.md
@@ -242,12 +242,10 @@
 #### $wgMFMobileHeader
 
 Requests containing header with this name will be considered as coming from
-mobile devices. The default value is for backwards compatibility.
-
-Set to `false` to explicitly disable this way of detection.
+mobile devices.
 
 * Type: `String`
-* Default: `'X-WAP'`
+* Default: `'X-Subdomain'`
 
 #### $wgMinervaBottomLanguageButton
 
diff --git a/extension.json b/extension.json
index c356b50..bd92ff4 100644
--- a/extension.json
+++ b/extension.json
@@ -1970,7 +1970,7 @@
                "MFSpecialCaseMainPage": false,
                "MinervaEnableSiteNotice": false,
                "MFTidyMobileViewSections": true,
-               "MFMobileHeader": "X-WAP",
+               "MFMobileHeader": "X-Subdomain",
                "MFRemovableClasses": {
                        "beta": [],
                        "base": []
diff --git a/tests/phpunit/MobileContextTest.php 
b/tests/phpunit/MobileContextTest.php
index 7331e6b..c082f15 100644
--- a/tests/phpunit/MobileContextTest.php
+++ b/tests/phpunit/MobileContextTest.php
@@ -76,7 +76,7 @@
         */
        public function testGetMobileUrl() {
                $this->setMwGlobals( [
-                       'wgMFMobileHeader' => 'X-WAP',
+                       'wgMFMobileHeader' => 'X-Subdomain',
                        'wgMobileUrlTemplate' => '%h0.m.%h1.%h2',
                        'wgServer' => '//en.wikipedia.org',
                ] );
@@ -93,7 +93,7 @@
                                        $invokes++;
                        } ]
                ] );
-               $context->getRequest()->setHeader( 'X-WAP', 'no' );
+               $context->getRequest()->setHeader( 'X-Subdomain', 'M' );
                $this->assertEquals(
                        'http://en.m.wikipedia.org/wiki/Article',
                        $context->getMobileUrl( 
'http://en.wikipedia.org/wiki/Article' )
@@ -167,12 +167,12 @@
         */
        public function testUsingMobileDomain() {
                $this->setMwGlobals( [
-                       'wgMFMobileHeader' => 'X-WAP',
+                       'wgMFMobileHeader' => 'X-Subdomain',
                        'wgMobileUrlTemplate' => '%h0.m.%h1.%h2',
                ] );
                $context = $this->makeContext();
                $this->assertFalse( $context->usingMobileDomain() );
-               $context->getRequest()->setHeader( 'X-WAP', '1' );
+               $context->getRequest()->setHeader( 'X-Subdomain', 'M' );
                $this->assertTrue( $context->usingMobileDomain() );
        }
 
diff --git a/tests/phpunit/devices/DeviceDetectorServiceIntegrationTest.php 
b/tests/phpunit/devices/DeviceDetectorServiceIntegrationTest.php
index b297fe6..2dbe3a0 100644
--- a/tests/phpunit/devices/DeviceDetectorServiceIntegrationTest.php
+++ b/tests/phpunit/devices/DeviceDetectorServiceIntegrationTest.php
@@ -74,8 +74,7 @@
                // 
<https://github.com/wikimedia/operations-puppet/blob/2a2714c28eab25eed469375dc5322ea6a6ef85df/modules/varnish/templates/text-frontend.inc.vcl.erb#L74-L78>.
                // @codingStandardsIgnoreEnd
 
-               // @FIXME Change the default value of $wgMFMobileHeader to 
"X-Subdomain".
-               $this->request->setHeader( 'X-WAP', 'M' );
+               $this->request->setHeader( 'X-Subdomain', 'M' );
 
                $properties =  $this->detectDeviceProperties();
 
@@ -87,7 +86,7 @@
         * @FIXME Should this really be the case?
         */
        public function 
test_it_should_prioritize_the_amf_environment_variables() {
-               $this->request->setHeader( 'X-WAP', 'M' );
+               $this->request->setHeader( 'X-Subdomain', 'M' );
 
                $this->server[ 'AMF_DEVICE_IS_TABLET' ] = 'true';
 

-- 
To view, visit https://gerrit.wikimedia.org/r/315240
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I81774ed34c86fa607b5e8d4613af16a4b5f68f45
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Phuedx <samsm...@wikimedia.org>
Gerrit-Reviewer: Bmansurov <bmansu...@wikimedia.org>
Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to