Commit 3e164c0c authored by Georg Mittendorfer's avatar Georg Mittendorfer

Add TODO/FIXME

parent 8e742072
......@@ -121,7 +121,8 @@ public class IriApiHandler {
RateLimiter rateLimiter = rateLimitOperations.rateLimiter(ip, command.getCommand());
RateLimiter globalLimiter = rateLimitOperations.globalRateLimiter();
rateLimitOperations.applyContentSpecificRateLimitWeight(command, rateLimiter);
rateLimitOperations.applyContentSpecificRateLimitWeight(command, globalLimiter);
rateLimitOperations.applyContentSpecificRateLimitWeight(command, globalLimiter); // FIXME don't apply for global limit. Too difficult to configure properly.
responseEntityMono = responseEntityMono
.transform(RateLimiterOperator.of(rateLimiter))
.transform(RateLimiterOperator.of(globalLimiter));
......
......@@ -77,6 +77,7 @@ public class RateLimitOperations {
Objects.requireNonNull(rateLimiter, "No rate limiter. Command: " + command.getCommand() + "");
// TODO add test that only rate limited commands apply weight. otherwise configuration would get too difficult. e.g. what would be global ip limit per second?
if (rateLimitedCommands.contains(command.getCommand())) {
int weight = command.getRateLimitCount();
if (weight > 1) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment