mirror of
https://github.com/TecharoHQ/anubis.git
synced 2026-04-16 05:15:03 +00:00
feat(honeypot/naive): attempt to automatically filter out based on crawling
Signed-off-by: Xe Iaso <me@xeiaso.net>
This commit is contained in:
@@ -14,6 +14,14 @@ type Impl interface {
|
||||
Hash() string
|
||||
}
|
||||
|
||||
type Func func(*http.Request) (bool, error)
|
||||
|
||||
func (f Func) Check(r *http.Request) (bool, error) {
|
||||
return f(r)
|
||||
}
|
||||
|
||||
func (f Func) Hash() string { return internal.FastHash(fmt.Sprintf("%#v", f)) }
|
||||
|
||||
type List []Impl
|
||||
|
||||
// Check runs each checker in the list against the request.
|
||||
|
||||
Reference in New Issue
Block a user