MaxSem has submitted this change and it was merged.

Change subject: Adding X-Subdomain and X-CS to HTTP 301 Vary: header for Zero 
traffic.
......................................................................


Adding X-Subdomain and X-CS to HTTP 301 Vary: header for Zero traffic.

        * Current Vary header redirect does not include this.
        * Wrong redirects to [LANG_CODE].m.wikipedia.org may cause
          unnecessary charges to Zero users.

Change-Id: I903d4db7d6e4da09c7ccd7f08d43ac5a59590ee7
---
M includes/MobileFrontend.hooks.php
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  MaxSem: Verified; Looks good to me, approved
  jenkins-bot: Checked



diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 0c092e1..2c31e24 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -193,6 +193,10 @@
 
                // Bug 43123: force mobile URLs only for local redirects
                if ( MobileContext::isLocalUrl( $redirect ) ) {
+                       if ( isset( $_SERVER['HTTP_X_SUBDOMAIN'] ) && isset( 
$_SERVER['HTTP_X_CS'] ) ) {
+                               $out->addVaryHeader( 'X-Subdomain');
+                               $out->addVaryHeader( 'X-CS' );
+                       }
                        $redirect = $context->getMobileUrl( $redirect );
                }
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I903d4db7d6e4da09c7ccd7f08d43ac5a59590ee7
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: production
Gerrit-Owner: Dr0ptp4kt <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to