Yurik has uploaded a new change for review. https://gerrit.wikimedia.org/r/97122
Change subject: Removed X-DfltLang & X-DfltPage from zero VCLs ...................................................................... Removed X-DfltLang & X-DfltPage from zero VCLs !!! DO NOT +2 BEFORE THESE TWO PATCHES: -- https://gerrit.wikimedia.org/r/#/c/97107/ -- https://gerrit.wikimedia.org/r/#/c/97115/ All default language redirection for home pages should be handleded as redirects by the backend Change-Id: I75462edb12bfcdab18f7589aaa0a2901c4041b40 --- M templates/varnish/mobile-frontend.inc.vcl.erb M templates/varnish/zero.inc.vcl.erb 2 files changed, 1 insertion(+), 39 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/operations/puppet refs/changes/22/97122/1 diff --git a/templates/varnish/mobile-frontend.inc.vcl.erb b/templates/varnish/mobile-frontend.inc.vcl.erb index 6731af8..882b647 100644 --- a/templates/varnish/mobile-frontend.inc.vcl.erb +++ b/templates/varnish/mobile-frontend.inc.vcl.erb @@ -21,7 +21,6 @@ if (!req.http.X-Forwarded-Proto) { /* This call will always set the following req.http values: X-Subdomain = M or ZERO - X-DfltLang = en|fr|ru|... This value is only set if the carrier has been successfully detected X-CS = "502-13" */ @@ -73,24 +72,9 @@ unset req.http.Cookie; } - if (req.http.host == "m.wikipedia.org") { - if (req.http.X-CS) { - // Carrier detected - error 666 "http://" + req.http.X-DfltLang + ".m.wikipedia.org" + req.http.X-DfltPage; - } else { - // Regular m.* request, unknown carrier, navigate to english page with the same URL - error 666 "http://en.m.wikipedia.org" + req.url; - } - } else if (req.http.host == "zero.wikipedia.org") { - // All ZERO requests should go to the Special:ZeroRatedMobileAccess, even for unknown carrier - error 666 "http://" + req.http.X-DfltLang + ".zero.wikipedia.org" + req.http.X-DfltPage; - } else if (req.http.host == "mobile.wikipedia.org") { + if (req.http.host == "mobile.wikipedia.org") { error 666 "http://en.mobile.wikipedia.org" + req.url; } - - // Don't need to redirect, unset default language - unset req.http.X-DfltLang; - unset req.http.X-DfltPage; call device_detection; @@ -143,10 +127,6 @@ } sub vcl_error { - // At this point we no longer need the default language. - unset req.http.X-DfltLang; - unset req.http.X-DfltPage; - /* Support mobile redirects */ if (obj.status == 666) { set obj.http.Location = obj.response; diff --git a/templates/varnish/zero.inc.vcl.erb b/templates/varnish/zero.inc.vcl.erb index 5a8bfe6..019d984 100644 --- a/templates/varnish/zero.inc.vcl.erb +++ b/templates/varnish/zero.inc.vcl.erb @@ -38,10 +38,6 @@ set req.http.X-Subdomain = "M"; } - // go to english by default - set req.http.X-DfltLang = "en"; - set req.http.X-DfltPage = "/wiki/Special:ZeroRatedMobileAccess"; - /* Please keep this list alphabetized by the ACL variable */ if (!req.http.X-CS2) { // Unknown IP - skip the rest of X-CS identification @@ -50,7 +46,6 @@ set req.http.X-CS = "502-13"; } } else if (req.http.X-CS2 == "623-03") { - set req.http.X-DfltLang = "fr"; if (req.http.X-Subdomain == "M") { if (req.http.host ~ "(^(fr|ar|sg|en|es|zh|ha|ln|eo)\.m|^m)\.wikipedia\.") { set req.http.X-CS = "623-03"; @@ -69,12 +64,10 @@ } } } else if (req.http.X-CS2 == "520-18") { - set req.http.X-DfltLang = "th"; if (req.http.X-Subdomain == "ZERO") { set req.http.X-CS = "520-18"; } } else if (req.http.X-CS2 == "470-01") { - set req.http.X-DfltLang = "bn"; if (req.http.X-Subdomain == "ZERO") { if (req.http.host ~ "(^(bn)\.zero|^zero)\.wikipedia\.") { set req.http.X-CS = "470-01"; @@ -97,19 +90,16 @@ set req.http.X-CS = "652-02"; } } else if (req.http.X-CS2 == "624-02") { - set req.http.X-DfltLang = "fr"; if (req.http.X-Subdomain == "M") { if (req.http.host ~ "(^(fr|en|es|de|zh|ar|ha|ln|yo|eo)\.m|^m)\.wikipedia\.") { set req.http.X-CS = "624-02"; } } } else if (req.http.X-CS2 == "630-86") { - set req.http.X-DfltLang = "fr"; if (req.http.X-Subdomain == "M") { set req.http.X-CS = "630-86"; } } else if (req.http.X-CS2 == "612-03") { - set req.http.X-DfltLang = "fr"; if (req.http.X-Subdomain == "M") { set req.http.X-CS = "612-03"; } @@ -118,19 +108,16 @@ set req.http.X-CS = "639-07"; } } else if (req.http.X-CS2 == "604-00") { - set req.http.X-DfltLang = "fr"; if (req.http.X-Subdomain == "M") { if (req.http.host ~ "(^(fr|ar|en|es|de|it|nl|pt|ru|zh)\.m|^m)\.wikipedia\.") { set req.http.X-CS = "604-00"; } } } else if (req.http.X-CS2 == "614-04") { - set req.http.X-DfltLang = "fr"; if (req.http.X-Subdomain == "M") { set req.http.X-CS = "614-04"; } } else if (req.http.X-CS2 == "605-01") { - set req.http.X-DfltLang = "fr"; if (req.http.X-Subdomain == "M") { if (req.http.host ~ "(^(ar|en|fr|es|de|it|ru|ja|zh)\.m|^m)\.wikipedia\.") { set req.http.X-CS = "605-01"; @@ -143,7 +130,6 @@ } } } else if (req.http.X-CS2 == "420-01") { - set req.http.X-DfltLang = "ar"; if (req.http.host ~ "(^(ar|bn|en|tl|ur)\.(zero|m)|^(zero|m))\.wikipedia\.") { set req.http.X-CS = "420-01"; } @@ -153,7 +139,6 @@ set req.http.X-CS = "405-25"; } } else if (req.http.X-CS2 == "250-99") { - set req.http.X-DfltLang = "ru"; if (req.http.host ~ "(^(en|ru)\.(zero|m)|^(zero|m))\.wikipedia\.") { set req.http.X-CS = "250-99"; } @@ -166,14 +151,12 @@ set req.http.X-CS = "404-01"; } } else if (req.http.X-CS2 == "510-11") { - set req.http.X-DfltLang = "id"; if (req.http.X-Subdomain == "ZERO") { if (req.http.host ~ "(^(id|en|zh|ar|hi|ms|jv|su)\.zero|^zero)\.wikipedia\.") { set req.http.X-CS = "510-11"; } } } else if (req.http.X-CS2 == "646-02") { - set req.http.X-DfltLang = "fr"; if (req.http.X-Subdomain == "M") { if (req.http.host ~ "(^(fr|en|mg)\.m|^m)\.wikipedia\.") { set req.http.X-CS = "646-02"; @@ -184,7 +167,6 @@ set req.http.X-CS = "436-01"; } } else if (req.http.X-CS2 == "401-01") { - set req.http.X-DfltLang = "ru"; if (req.http.host ~ "(^(ru|kk|en)\.(zero|m)|^(zero|m))\.wikipedia\.") { set req.http.X-CS = "401-01"; } -- To view, visit https://gerrit.wikimedia.org/r/97122 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I75462edb12bfcdab18f7589aaa0a2901c4041b40 Gerrit-PatchSet: 1 Gerrit-Project: operations/puppet Gerrit-Branch: production Gerrit-Owner: Yurik <yu...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits