diff options
| author | Amogh Pradeep <amoghbl1@gmail.com> | 2015-06-25 18:57:12 -0500 |
|---|---|---|
| committer | Arlo Breault <arlolra@gmail.com> | 2015-06-25 21:42:32 -0700 |
| commit | 749fd988c32e764e7fc8dde1f59ab7f06a63f0cd (patch) | |
| tree | d23a35745456af51ed9632c52f23d19e8e6e5213 | |
| parent | 682823141993e77cb5151ad655ec612550a678a5 (diff) | |
Added Orfox user agent identification to regexp
| -rw-r--r-- | utils.go | 2 | ||||
| -rw-r--r-- | utils_test.go | 1 |
2 files changed, 2 insertions, 1 deletions
@@ -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) diff --git a/utils_test.go b/utils_test.go index b16a475..4f60b57 100644 --- a/utils_test.go +++ b/utils_test.go @@ -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) { |
