Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Wilkins2015-04-30 03:51:27 +0000
committerGreg Wilkins2015-04-30 03:51:27 +0000
commitb5818034eb4cf6bc3f8bb5fef1ac44e8f4cf5986 (patch)
tree7d55f8799ed25f5161aae955ab0e506846a909f9
parent25474ff7ab41a93d3c89de7ddc3f04b384c51762 (diff)
downloadorg.eclipse.jetty.project-b5818034eb4cf6bc3f8bb5fef1ac44e8f4cf5986.tar.gz
org.eclipse.jetty.project-b5818034eb4cf6bc3f8bb5fef1ac44e8f4cf5986.tar.xz
org.eclipse.jetty.project-b5818034eb4cf6bc3f8bb5fef1ac44e8f4cf5986.zip
465734 DosFilter whitelist bit pattern fix
removed conflicting setter
-rw-r--r--jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java18
-rw-r--r--jetty-servlets/src/test/java/org/eclipse/jetty/servlets/DoSFilterTest.java2
2 files changed, 4 insertions, 16 deletions
diff --git a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java
index ad758b18bf..f1e331591a 100644
--- a/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java
+++ b/jetty-servlets/src/main/java/org/eclipse/jetty/servlets/DoSFilter.java
@@ -1031,29 +1031,17 @@ public class DoSFilter implements Filter
/**
* Set a list of IP addresses that will not be rate limited.
*
- * @param value comma-separated whitelist
+ * @param commaSeparatedList comma-separated whitelist
*/
- public void setWhitelist(String value)
+ public void setWhitelist(String commaSeparatedList)
{
List<String> result = new ArrayList<>();
- for (String address : value.split(","))
+ for (String address : commaSeparatedList.split(","))
addWhitelistAddress(result, address);
clearWhitelist();
_whitelist.addAll(result);
LOG.debug("Whitelisted IP addresses: {}", result);
}
-
- /**
- * Set a list of IP addresses that will not be rate limited.
- *
- * @param values whitelist
- */
- public void setWhitelist(List<String> values)
- {
- clearWhitelist();
- _whitelist.addAll(values);
- LOG.debug("Whitelisted IP addresses: {}", values);
- }
/**
* Clears the list of whitelisted IP addresses
diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/DoSFilterTest.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/DoSFilterTest.java
index 93177e9025..35001a2027 100644
--- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/DoSFilterTest.java
+++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/DoSFilterTest.java
@@ -82,7 +82,7 @@ public class DoSFilterTest extends AbstractDoSFilterTest
whitelist.add("10.0.0.0/8");
whitelist.add("4d8:0:a:1234:ABc:1F:b18:17");
whitelist.add("4d8:0:a:1234:ABc:1F:0:0/96");
- filter.setWhitelist(whitelist);
+ filter.setWhitelist("192.168.0.1/32,10.0.0.0/8,4d8:0:a:1234:ABc:1F:b18:17,4d8:0:a:1234:ABc:1F:0:0/96");
Assert.assertTrue(filter.checkWhitelist("192.168.0.1"));
Assert.assertFalse(filter.checkWhitelist("192.168.0.2"));
Assert.assertFalse(filter.checkWhitelist("11.12.13.14"));

Back to the top