summaryrefslogtreecommitdiffhomepage
path: root/http/ua_detector.go
blob: aa250258f3d7194554071337cd634cef7a1ceadb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package http

import "strings"

var (
	browsers = []string{
		"Firefox/",
		"Chrome/",
		"Safari/",
		"OPR/",
		"Edge/",
		"Trident/",
	}
)

func isBrowser(ua string) bool {
	for _, el := range browsers {
		if strings.Contains(ua, el) {
			return true
		}
	}
	return false
}