Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
tor-check
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Network Health
Metrics
tor-check
Commits
749fd988
Commit
749fd988
authored
9 years ago
by
Amogh Pradeep
Committed by
Arlo Breault
9 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Added Orfox user agent identification to regexp
parent
68282314
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
utils.go
+1
-1
1 addition, 1 deletion
utils.go
utils_test.go
+1
-0
1 addition, 0 deletions
utils_test.go
with
2 additions
and
1 deletion
utils.go
+
1
−
1
View file @
749fd988
...
...
@@ -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
)
...
...
This diff is collapsed.
Click to expand it.
utils_test.go
+
1
−
0
View file @
749fd988
...
...
@@ -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
)
{
...
...
This diff is collapsed.
Click to expand it.
Arlo Breault
@arlo
mentioned in commit
aa25675a
·
3 years ago
mentioned in commit
aa25675a
mentioned in commit aa25675a220bc91104fd887216d09314ca26c822
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment