Fix errors

This commit is contained in:
Daniel Mason 2021-03-27 12:29:11 +13:00
parent 50154a009c
commit fc1d6fc567
5 changed files with 27 additions and 35 deletions

View file

@ -145,7 +145,7 @@ func limitMiddleware(next http.HandlerFunc, limiter *IPRateLimiter) http.Handler
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
limiter := limiter.GetLimiter(r.RemoteAddr)
if !limiter.Allow() {
msg := generateJsonError("Too many requests")
msg := generateJsonMessage("Too many requests")
w.WriteHeader(http.StatusTooManyRequests)
w.Write(msg)
return