Skip to content

Commit 774a2e6

Browse files
committed
Polish setAllowedHostnames
Added JavaDoc to method, including @SInCE attribute Issue gh-4310
1 parent f712c55 commit 774a2e6

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

web/src/main/java/org/springframework/security/web/firewall/StrictHttpFirewall.java

+12-4
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616

1717
package org.springframework.security.web.firewall;
1818

19-
import org.springframework.http.HttpMethod;
20-
21-
import javax.servlet.http.HttpServletRequest;
22-
import javax.servlet.http.HttpServletResponse;
2319
import java.util.Arrays;
2420
import java.util.Collection;
2521
import java.util.Collections;
2622
import java.util.HashSet;
2723
import java.util.List;
2824
import java.util.Set;
2925
import java.util.function.Predicate;
26+
import javax.servlet.http.HttpServletRequest;
27+
import javax.servlet.http.HttpServletResponse;
28+
29+
import org.springframework.http.HttpMethod;
3030

3131
/**
3232
* <p>
@@ -305,6 +305,14 @@ public void setAllowUrlEncodedPercent(boolean allowUrlEncodedPercent) {
305305
}
306306
}
307307

308+
/**
309+
* <p>
310+
* Determines which hostnames should be allowed. The default is to allow any hostname.
311+
* </p>
312+
*
313+
* @param allowedHostnames the predicate for testing hostnames
314+
* @since 5.2
315+
*/
308316
public void setAllowedHostnames(Predicate<String> allowedHostnames) {
309317
if (allowedHostnames == null) {
310318
throw new IllegalArgumentException("allowedHostnames cannot be null");

0 commit comments

Comments
 (0)