MCPcopy Create free account
hub / github.com/GoEdgeLab/EdgeNode / IsAgentFromUserAgent

Function IsAgentFromUserAgent

internal/utils/agents/agents.go:20–31  ·  view source on GitHub ↗
(userAgent string)

Source from the content-addressed store, hash-verified

18}
19
20func IsAgentFromUserAgent(userAgent string) bool {
21 for _, agent := range AllAgents {
22 if len(agent.Keywords) > 0 {
23 for _, keyword := range agent.Keywords {
24 if strings.Contains(userAgent, keyword) {
25 return true
26 }
27 }
28 }
29 }
30 return false
31}

Callers 3

TestIsAgentFromUserAgentFunction · 0.92
AddUserAgentMethod · 0.92

Calls 1

ContainsMethod · 0.45

Tested by 2

TestIsAgentFromUserAgentFunction · 0.74