From 78f3b5c9fbc8a46c6457a8aff3bcb7f31603c8f9 Mon Sep 17 00:00:00 2001 From: gregw Date: Thu, 19 Oct 2023 08:44:50 +1100 Subject: [PATCH] Simplify the DosFilter for #1256 Use only IP tracking for the DosFilter. Fix defaults Signed-off-by: gregw --- .../src/main/java/org/eclipse/jetty/servlets/DoSFilter.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 f3f6a09e02b9..d9186282adac 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 @@ -241,10 +241,10 @@ public void init(FilterConfig filterConfig) throws ServletException setInsertHeaders(parameter == null || Boolean.parseBoolean(parameter)); parameter = filterConfig.getInitParameter(TRACK_SESSIONS_INIT_PARAM); - setTrackSessions(parameter == null || Boolean.parseBoolean(parameter)); + setTrackSessions(Boolean.parseBoolean(parameter)); parameter = filterConfig.getInitParameter(REMOTE_PORT_INIT_PARAM); - setRemotePort(parameter != null && Boolean.parseBoolean(parameter)); + setRemotePort(Boolean.parseBoolean(parameter)); parameter = filterConfig.getInitParameter(ENABLED_INIT_PARAM); setEnabled(parameter == null || Boolean.parseBoolean(parameter));