asn blocking!!!!!

This commit is contained in:
2026-11-22 22:08:12 -05:00
parent 41ba8dfb90
commit 1834abc719
10 changed files with 130 additions and 25 deletions
+3 -3
View File
@@ -34,8 +34,8 @@ func NewRateLimiter(refillEvery time.Duration, burst int, pages *p.Pages, resolv
}
}
func (rl *RateLimiter) LimitRequest(next http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
func (rl *RateLimiter) LimitRequest(next http.HandlerFunc) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ip, err := rl.resolveIP(r)
if err != nil {
rl.pages.HTTPError(w, r, "couldn't idenitify client address", http.StatusInternalServerError)
@@ -61,5 +61,5 @@ func (rl *RateLimiter) LimitRequest(next http.HandlerFunc) http.HandlerFunc {
return
}
next(w, r)
}
})
}