summaryrefslogtreecommitdiffhomepage
path: root/http/ua_detector.go
diff options
context:
space:
mode:
Diffstat (limited to 'http/ua_detector.go')
-rw-r--r--http/ua_detector.go23
1 files changed, 23 insertions, 0 deletions
diff --git a/http/ua_detector.go b/http/ua_detector.go
new file mode 100644
index 0000000..aa25025
--- /dev/null
+++ b/http/ua_detector.go
@@ -0,0 +1,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
+}