Skip to content

Commit 66f8a56

Browse files
committed
Polish setAllowedHostnames
Added JavaDoc to method, including @SInCE attribute Issue gh-4310
1 parent 3e5b65f commit 66f8a56

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616

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

19-
import javax.servlet.http.HttpServletRequest;
20-
import javax.servlet.http.HttpServletResponse;
2119
import java.util.Arrays;
2220
import java.util.Collection;
2321
import java.util.Collections;
2422
import java.util.HashSet;
2523
import java.util.List;
2624
import java.util.Set;
2725
import java.util.function.Predicate;
26+
import javax.servlet.http.HttpServletRequest;
27+
import javax.servlet.http.HttpServletResponse;
2828

2929
/**
3030
* <p>
@@ -238,6 +238,14 @@ public void setAllowUrlEncodedPercent(boolean allowUrlEncodedPercent) {
238238
}
239239
}
240240

241+
/**
242+
* <p>
243+
* Determines which hostnames should be allowed. The default is to allow any hostname.
244+
* </p>
245+
*
246+
* @param allowedHostnames the predicate for testing hostnames
247+
* @since 5.0.17
248+
*/
241249
public void setAllowedHostnames(Predicate<String> allowedHostnames) {
242250
if (allowedHostnames == null) {
243251
throw new IllegalArgumentException("allowedHostnames cannot be null");

0 commit comments

Comments
 (0)