BBlack has submitted this change and it was merged.
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: I176b6c188cdd9e5f99cd37c0bd8eff8636bce6b7
---
M templates/varnish/zero.inc.vcl.erb
1 file changed, 6 insertions(+), 7 deletions(-)
Approvals:
BBlack: Looks good to me, approved
jenkins-bot: Verified
diff --git a/templates/varnish/zero.inc.vcl.erb
b/templates/varnish/zero.inc.vcl.erb
index af27241..dea0969 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) {
+ // 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/86708
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I176b6c188cdd9e5f99cd37c0bd8eff8636bce6b7
Gerrit-PatchSet: 3
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Yurik <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits