Spark stage : Add a traffic script for mobile detection

VERIFIED FIXED

Status

mozilla.org Graveyard
Server Operations
--
major
VERIFIED FIXED
7 years ago
3 years ago

People

(Reporter: Franck Lecollinet, Assigned: oremj)

Tracking

Details

(URL)

(Reporter)

Description

7 years ago
This is very similar to bug 640034 for webowonder stage.

Please add the following script allowing Zeus to do mobile detection:


$ua_f = "(android|fennec|iemobile|ipad|iphone|opera (mini|mobi))";
$mc_f = "mobile";

$ua = string.lowercase(http.getHeader( "User-Agent" ));
$mc = http.getCookie($mc_f);

if(($mc != "off" && string.regexmatch($ua, $ua_f)) || $mc == "on") {
  http.addHeader("X-Mobile", 1);
  http.cache.setkey("mobile");
  http.addResponseHeader("Vary", "Cookie,User-Agent");

}
(Reporter)

Updated

7 years ago
Assignee: nobody → server-ops
Component: spark.mozilla.org → Server Operations
Product: Websites → mozilla.org
QA Contact: spark-mozilla-org → mrz
Version: unspecified → other
(Reporter)

Updated

7 years ago
Severity: normal → major
OS: Mac OS X → All
Hardware: x86 → All
(Reporter)

Updated

7 years ago
(Assignee)

Comment 1

7 years ago
This should already be active for spark.allizom
Assignee: server-ops → jeremy.orem+bugs
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
(Reporter)

Comment 2

7 years ago
On bug 640034 the cookie value in $mc_f is "mamo". 
This seems to originally come from AMO so I changed it to "mobile" for Spark in the above script and Spark settings.

Please confirm which value is configured.
(Assignee)

Comment 3

7 years ago
Jeff, can we standardize on one value?
(In reply to comment #3)
> Jeff, can we standardize on one value?

Yeah, I don't care what it's called. I don't know how many people have our mamo cookie installed, so I don't know how many people will be affected by the name change.
Verified FIXED -- this was working fine for dark launch, after oremj opened up the firewall, to fix the HTTP 500 errors.
Status: RESOLVED → VERIFIED
Product: mozilla.org → mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.