commit 8ced29cb67e979394cdd011bb7ab6611d5836be2 Author: Matthew Finkel Matthew.Finkel@gmail.com Date: Tue Apr 20 14:16:06 2021 +0000
Bug 40003: Tweak Tor Browser UAS for Fenix 88+ --- utils.go | 2 +- utils_test.go | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/utils.go b/utils.go index 2423025..ef74784 100644 --- a/utils.go +++ b/utils.go @@ -55,7 +55,7 @@ func GetHost(r *http.Request) (host string, err error) { return }
-var TBBUserAgents = regexp.MustCompile(`^Mozilla/5.0 ([^)]*) Gecko/20100101 Firefox/[\d]+.0$`) +var TBBUserAgents = regexp.MustCompile(`^Mozilla/5.0 ([^)]*) Gecko/([\d]+.0|20100101) Firefox/[\d]+.0$`) var OrfoxUserAgents = regexp.MustCompile(`^Mozilla/5.0 (Android; Mobile; rv:38.0) Gecko/38.0 Firefox/38.0$`)
func LikelyTBB(ua string) bool { diff --git a/utils_test.go b/utils_test.go index e01f652..9bba034 100644 --- a/utils_test.go +++ b/utils_test.go @@ -10,13 +10,14 @@ 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:31.0) Gecko/31.0 Firefox/31.0": false, + "Mozilla/5.0 (Android; Mobile; rv:31.0) Gecko/31.0 Firefox/31.0": true, "Mozilla/5.0 (Android; Mobile; rv:38.0) Gecko/38.0 Firefox/38.0": true, "Mozilla/5.0 (Windows NT 6.1; rv:52.0) Gecko/20100101 Firefox/52.0": true, "Mozilla/5.0 (Android; Mobile; rv:52.0) Gecko/20100101 Firefox/52.0": true, "Mozilla/5.0 (Windows NT 6.1; rv:60.0) Gecko/20100101 Firefox/60.0": true, "Mozilla/5.0 (Android; Mobile; rv:60.0) Gecko/20100101 Firefox/60.0": true, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:60.0) Gecko/20100101 Firefox/60.0": true, + "Mozilla/5.0 (Android 9; Mobile; rv:78.0) Gecko/78.0 Firefox/78.0": true, }
func TestLikelyTBB(t *testing.T) {
tor-commits@lists.torproject.org