From 774a2e669ca90e1569e2e196d570a7528c1842e4 Mon Sep 17 00:00:00 2001 From: Josh Cummings Date: Sat, 3 Aug 2019 19:19:44 -0600 Subject: [PATCH] Polish setAllowedHostnames Added JavaDoc to method, including @since attribute Issue gh-4310 --- .../web/firewall/StrictHttpFirewall.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/web/src/main/java/org/springframework/security/web/firewall/StrictHttpFirewall.java b/web/src/main/java/org/springframework/security/web/firewall/StrictHttpFirewall.java index 2884c9c9a8..25dfe2b3a1 100644 --- a/web/src/main/java/org/springframework/security/web/firewall/StrictHttpFirewall.java +++ b/web/src/main/java/org/springframework/security/web/firewall/StrictHttpFirewall.java @@ -16,10 +16,6 @@ package org.springframework.security.web.firewall; -import org.springframework.http.HttpMethod; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; import java.util.Arrays; import java.util.Collection; import java.util.Collections; @@ -27,6 +23,10 @@ import java.util.HashSet; import java.util.List; import java.util.Set; import java.util.function.Predicate; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.http.HttpMethod; /** *

@@ -305,6 +305,14 @@ public class StrictHttpFirewall implements HttpFirewall { } } + /** + *

+ * Determines which hostnames should be allowed. The default is to allow any hostname. + *

+ * + * @param allowedHostnames the predicate for testing hostnames + * @since 5.2 + */ public void setAllowedHostnames(Predicate allowedHostnames) { if (allowedHostnames == null) { throw new IllegalArgumentException("allowedHostnames cannot be null");