Yurik has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/86709


Change subject: Set X-CS for all carriers identified by netmapper by default
......................................................................

Set X-CS for all carriers identified by netmapper by default

* Any new carrier is whitelisted for all languages for both m & zero,
so we can just use the value returned from netmapper for X-CS header.
* Removed any specific carriers that are whitelisted in all cases.

Change-Id: I490ce7e4f46cf5b1924a2ce7e39fce0553a41ab9
---
M templates/varnish/zero.inc.vcl.erb
1 file changed, 6 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/09/86709/1

diff --git a/templates/varnish/zero.inc.vcl.erb 
b/templates/varnish/zero.inc.vcl.erb
index af27241..ebc74f7 100644
--- a/templates/varnish/zero.inc.vcl.erb
+++ b/templates/varnish/zero.inc.vcl.erb
@@ -43,7 +43,9 @@
        set req.http.X-DfltPage = "/wiki/Special:ZeroRatedMobileAccess";
 
        /* Please keep this list alphabetized by the ACL variable */
-       if (req.http.X-CS2 == "502-13") {
+       if (!req.http.X-CS2 || req.http.X-CS2 == "") {
+               // Unknown IP - skip the rest of X-CS identification
+       } else if (req.http.X-CS2 == "502-13") {
                if (req.http.X-Subdomain == "ZERO") {
                        set req.http.X-CS = "502-13";
                }
@@ -145,17 +147,11 @@
                if (req.http.host ~ 
"(^(ar|bn|en|tl|ur)\.(zero|m)|^(zero|m))\.([a-zA-Z0-9-]+)\.org") {
                        set req.http.X-CS = "420-01";
                }
-       } else if (req.http.X-CS2 == "639-02") {
-               set req.http.X-CS = "639-02";
        } else if (req.http.X-CS2 == "405-25") {
                if (req.http.X-Subdomain == "ZERO") {
                        /* MCC-MNC not clear from 
http://en.wikipedia.org/wiki/Mobile_country_code */
                        set req.http.X-CS = "405-25";
                }
-       } else if (req.http.X-CS2 == "297-01") {
-               set req.http.X-CS = "297-01";
-       } else if (req.http.X-CS2 == "426-04") {
-               set req.http.X-CS = "426-04";
        } else if (req.http.X-CS2 == "250-99") {
                set req.http.X-DfltLang = "ru";
                if (req.http.host ~ 
"(^(en|ru)\.(zero|m)|^(zero|m))\.([a-zA-Z0-9-]+)\.org") {
@@ -192,6 +188,9 @@
                if (req.http.host ~ 
"(^(ru|kk|en)\.(zero|m)|^(zero|m))\.([a-zA-Z0-9-]+)\.org") {
                        set req.http.X-CS = "401-01";
                }
+       } else {
+               // Any new carriers are signed up as both m & zero for all 
languages
+               set req.http.X-CS = req.http.X-CS2;
        }
        /* Please keep the above list alphabetized by the ACL variable */
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I490ce7e4f46cf5b1924a2ce7e39fce0553a41ab9
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yurik <[email protected]>

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

Reply via email to