MCPcopy Create free account
hub / github.com/chainreactors/EvilProxy / MatchAgentProfile

Function MatchAgentProfile

internal/sessions/transfer.go:101–109  ·  view source on GitHub ↗

--------------------------------------------------------------------------- Agent profile matching --------------------------------------------------------------------------- MatchAgentProfile returns the AgentProfile matching the given User-Agent string. Falls back to defaultProfile if no known age

(userAgent string)

Source from the content-addressed store, hash-verified

99// MatchAgentProfile returns the AgentProfile matching the given User-Agent string.
100// Falls back to defaultProfile if no known agent is matched.
101func MatchAgentProfile(userAgent string) AgentProfile {
102 lower := strings.ToLower(userAgent)
103 for _, p := range knownAgentProfiles {
104 if strings.Contains(lower, p.UserAgentPattern) {
105 return p
106 }
107 }
108 return defaultProfile
109}
110
111// ---------------------------------------------------------------------------
112// Transfer planning

Callers 10

HandleMethod · 0.92
probeAndDownloadMethod · 0.92
PlanUploadFunction · 0.85
PlanDownloadFunction · 0.85

Calls

no outgoing calls