mirror of
https://github.com/aljazceru/njump.git
synced 2026-02-02 20:54:30 +01:00
block claude.
This commit is contained in:
3
block.go
3
block.go
@@ -18,6 +18,7 @@ func agentBlock(next http.HandlerFunc) http.HandlerFunc {
|
||||
"Yandex",
|
||||
"meta-externalagent",
|
||||
"DotBot",
|
||||
"ClaudeBot",
|
||||
} {
|
||||
if strings.Contains(ua, bua) {
|
||||
// log.Debug().Str("ua", ua).Msg("user-agent blocked")
|
||||
@@ -67,7 +68,7 @@ func ipBlock(next http.HandlerFunc) http.HandlerFunc {
|
||||
if ip != nil {
|
||||
for _, ipnet := range ranges {
|
||||
if ipnet.Contains(ip) {
|
||||
log.Debug().Stringer("ip", ip).Msg("cloudflare (attacker) ip blocked")
|
||||
log.Debug().Stringer("ip", ip).Msg("ip blocked")
|
||||
http.Error(w, "Forbidden", http.StatusForbidden)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user