Add hasText assertion to IpAddressMatcher constructor

Issue gh-15527

(cherry picked from commit 3a29819651)
This commit is contained in:
Steve Riesenberg
2024-11-14 23:12:51 -06:00
parent 554df6fab6
commit ddf4542a9e
2 changed files with 15 additions and 0 deletions

View File

@@ -50,6 +50,7 @@ public final class IpAddressMatcher implements RequestMatcher {
* come.
*/
public IpAddressMatcher(String ipAddress) {
Assert.hasText(ipAddress, "ipAddress cannot be empty");
assertNotHostName(ipAddress);
if (ipAddress.indexOf('/') > 0) {
String[] addressAndMask = StringUtils.split(ipAddress, "/");