Commit 749fd988 authored by Amogh Pradeep's avatar Amogh Pradeep Committed by Arlo Breault
Browse files

Added Orfox user agent identification to regexp

parent 68282314
......@@ -55,7 +55,7 @@ func GetHost(r *http.Request) (host string, err error) {
return
}
var TBBUserAgents = regexp.MustCompile(`^Mozilla/5\.0 \(Windows NT 6\.1; rv:[\d]+\.0\) Gecko/20100101 Firefox/[\d]+\.0$`)
var TBBUserAgents = regexp.MustCompile(`^Mozilla/5\.0 \(((Windows NT 6\.1)|(Android; Mobile)); rv:[\d]+\.0\) Gecko/20100101 Firefox/[\d]+\.0$`)
func LikelyTBB(ua string) bool {
return TBBUserAgents.MatchString(ua)
......
......@@ -10,6 +10,7 @@ var UserAgents = map[string]bool{
"Mozilla/5.0 (Windows NT 6.1; rv:10.0) Gecko/20100101 Firefox/10.0": true,
"Mozilla/5.0 (Windows NT 6.1; rv:17.0) Gecko/20100101 Firefox/17.0": true,
"Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Firefox/24.0": true,
"Mozilla/5.0 (Android; Mobile; rv:24.0) Gecko/20100101 Firefox/24.0": true,
}
func TestLikelyTBB(t *testing.T) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment