mirror of
https://github.com/portainer/portainer.git
synced 2025-07-24 15:59:41 +02:00
fix(code): clean up EE-4432 (#7865)
This commit is contained in:
parent
367f3dd6d4
commit
ae2bec4bd9
21 changed files with 25 additions and 111 deletions
|
@ -29,7 +29,7 @@ func NewRateLimiter(maxRequests int, duration time.Duration, banDuration time.Du
|
|||
func (limiter *RateLimiter) LimitAccess(next http.Handler) http.Handler {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
ip := StripAddrPort(r.RemoteAddr)
|
||||
if banned := limiter.Inc(ip); banned == true {
|
||||
if banned := limiter.Inc(ip); banned {
|
||||
httperror.WriteError(w, http.StatusForbidden, "Access denied", errors.ErrResourceAccessDenied)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue