asn blocking!!!!!
This commit is contained in:
@@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user