Enforcing a global rate limit.

This commit is contained in:
Maxime Delporte
2025-11-16 10:36:36 +01:00
parent e93375d441
commit 8b0c51123f
5 changed files with 27 additions and 1 deletions

View File

@@ -61,3 +61,8 @@ func (app *application) editConflictResponse(w http.ResponseWriter, r *http.Requ
message := "unable to update the record due to an edit conflict, please try again"
app.errorResponse(w, r, http.StatusConflict, message)
}
func (app *application) rateLimitExceededResponse(w http.ResponseWriter, r *http.Request) {
message := "rate limit exceeded"
app.errorResponse(w, r, http.StatusTooManyRequests, message)
}