Reputation: 159
In spring cloud gw redis rate limiter impl, there are headers infos like X-RateLimit-Remaining, X-RateLimit-Requested-Tokens, X-RateLimit-Burst-Capacity, X-RateLimit-Replenish-Rate. I dont want to give that information to clint due to some security issues.
There is a way to remove those headers on response even if request got 429?
Thanks
Upvotes: 1
Views: 427
Reputation: 149
One potential solution to the problem is to configure special field for each instance of the RedisRateLimiter
.
For example:
@Configuration
public class RateLimiterConfiguration {
public RateLimiterConfiguration(List<RedisRateLimiter> rateLimiters) {
rateLimiters.forEach(rateLimiter -> rateLimiter.setIncludeHeaders(false));
}
}
Upvotes: 0