MCPcopy
hub / github.com/TecharoHQ/anubis / CheckNetwork

Method CheckNetwork

internal/honeypot/naive/naive.go:104–113  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

102}
103
104func (i *Impl) CheckNetwork() checker.Impl {
105 return checker.Func(func(r *http.Request) (bool, error) {
106 result, _ := i.uaWeight.Get(r.Context(), internal.SHA256sum(r.UserAgent()))
107 if result >= 25 {
108 return true, nil
109 }
110
111 return false, nil
112 })
113}
114
115func (i *Impl) Hash() string {
116 return internal.SHA256sum("naive honeypot")

Callers 1

NewFunction · 0.80

Calls 3

FuncFuncType · 0.92
SHA256sumFunction · 0.92
GetMethod · 0.65

Tested by

no test coverage detected