Skip to content

Commit d80b186

Browse files
committed
Polish setAllowedHostnames
Added JavaDoc to method, including @SInCE attribute Issue gh-4310
1 parent 52c80c7 commit d80b186

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>
@@ -285,6 +285,14 @@ public void setAllowUrlEncodedPercent(boolean allowUrlEncodedPercent) {
285285
}
286286
}
287287

288+
/**
289+
* <p>
290+
* Determines which hostnames should be allowed. The default is to allow any hostname.
291+
* </p>
292+
*
293+
* @param allowedHostnames the predicate for testing hostnames
294+
* @since 5.1.11
295+
*/
288296
public void setAllowedHostnames(Predicate<String> allowedHostnames) {
289297
if (allowedHostnames == null) {
290298
throw new IllegalArgumentException("allowedHostnames cannot be null");

0 commit comments

Comments
 (0)