aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/config
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-06-25 07:54:39 -0700
committerAnton Tananaev <anton@traccar.org>2022-06-25 07:54:39 -0700
commit5a732a26c85785a9b801583f2fff0ce47314aa03 (patch)
tree97eb67d1492e08603c26de14f6b663bfeb2c0406 /src/main/java/org/traccar/config
parentc60743cfab4e31214207da5dab44fc4426d53764 (diff)
downloadtrackermap-server-5a732a26c85785a9b801583f2fff0ce47314aa03.tar.gz
trackermap-server-5a732a26c85785a9b801583f2fff0ce47314aa03.tar.bz2
trackermap-server-5a732a26c85785a9b801583f2fff0ce47314aa03.zip
Add throttling filter
Diffstat (limited to 'src/main/java/org/traccar/config')
-rw-r--r--src/main/java/org/traccar/config/Keys.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/config/Keys.java b/src/main/java/org/traccar/config/Keys.java
index 3f52fbd96..8e11b4013 100644
--- a/src/main/java/org/traccar/config/Keys.java
+++ b/src/main/java/org/traccar/config/Keys.java
@@ -629,6 +629,13 @@ public final class Keys {
List.of(KeyType.CONFIG));
/**
+ * Maximum API requests per second. Above this limit requests and delayed and throttled.
+ */
+ public static final ConfigKey<Integer> WEB_MAX_REQUESTS_PER_SECOND = new IntegerConfigKey(
+ "web.maxRequestsPerSec",
+ List.of(KeyType.CONFIG));
+
+ /**
* Sanitize all strings returned via API. This is needed to fix XSS issues in the old web interface. New React-based
* interface doesn't require this.
*/