Polish setAllowedHostnames

Added JavaDoc to method, including @since attribute

Issue gh-4310
This commit is contained in:
Josh Cummings 2019-08-03 19:19:44 -06:00
parent f712c5598c
commit 774a2e669c
No known key found for this signature in database
GPG Key ID: 49EF60DD7FF83443
1 changed files with 12 additions and 4 deletions

View File

@ -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;
/**
* <p>
@ -305,6 +305,14 @@ public class StrictHttpFirewall implements HttpFirewall {
}
}
/**
* <p>
* Determines which hostnames should be allowed. The default is to allow any hostname.
* </p>
*
* @param allowedHostnames the predicate for testing hostnames
* @since 5.2
*/
public void setAllowedHostnames(Predicate<String> allowedHostnames) {
if (allowedHostnames == null) {
throw new IllegalArgumentException("allowedHostnames cannot be null");