Add an "excessively large object" safeguard.

This commit is contained in:
Jon Chambers
2021-05-18 14:18:39 -04:00
committed by Jon Chambers
parent fbaf4a09e2
commit 28e3b23e8c
4 changed files with 67 additions and 3 deletions

View File

@@ -25,6 +25,9 @@ public class TorExitNodeConfiguration {
@NotBlank
private String objectKey;
@JsonProperty
private long maxSize = 16 * 1024 * 1024;
@JsonProperty
private Duration refreshInterval = Duration.ofMinutes(5);
@@ -45,6 +48,15 @@ public class TorExitNodeConfiguration {
return objectKey;
}
public long getMaxSize() {
return maxSize;
}
@VisibleForTesting
public void setMaxSize(final long maxSize) {
this.maxSize = maxSize;
}
public Duration getRefreshInterval() {
return refreshInterval;
}