mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-10 13:42:02 +00:00
Add a Retry-After header when rate limit is exceeded
This commit is contained in:
@@ -72,6 +72,7 @@ func RateLimit(rl util.RateLimiter, handler http.Handler) http.Handler {
|
||||
return
|
||||
}
|
||||
w.WriteHeader(http.StatusServiceUnavailable)
|
||||
w.Header().Set("Retry-After", "1")
|
||||
fmt.Fprintf(w, "Rate limit exceeded.")
|
||||
})
|
||||
}
|
||||
|
Reference in New Issue
Block a user