fix: auth and ratelimit middleware return JSON errors instead of text/plain

This commit is contained in:
2026-07-11 16:05:56 +01:00
parent e4a56ab04d
commit ce0bb43ebf
2 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -134,7 +134,7 @@ func RateLimit(limit int, window time.Duration) func(http.Handler) http.Handler
}
if !limiter.Allow(ip) {
http.Error(w, "Rate limit exceeded", http.StatusTooManyRequests)
RespondJSON(w, http.StatusTooManyRequests, map[string]string{"error": "Rate limit exceeded"})
return
}