feat(multiplayer): enforce account and IP rate limits

This commit is contained in:
Josh Creek
2026-09-01 19:18:40 +01:00
parent aa97259165
commit e1abac1271
4 changed files with 76 additions and 19 deletions
+1 -1
View File
@@ -207,7 +207,7 @@ func (s *Service) Handler() http.Handler {
var handler http.Handler = mux
if s.RateLimiter != nil {
handler = http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if !s.RateLimiter.Allow(requestRateKey(r), s.now()) {
if !s.RateLimiter.AllowKeys(requestRateKeys(r), s.now()) {
writeError(w, http.StatusTooManyRequests, "rate_limited")
return
}