From d99fedbf4f5dbc6f74a52ed0902b49b0f65bfc2e Mon Sep 17 00:00:00 2001 From: cyb3r4nt <104218001+cyb3r4nt@users.noreply.github.com> Date: Tue, 16 Aug 2022 17:40:35 +0300 Subject: [PATCH] Fix IP address parse error msg in IpAddressMatcher There is no whitespace between error message and IP address value `IpAddressMatcher#parseAddress()` If IP value is wrong, then error text looks like `Failed to parse addressi.am.ip`. There should be some separator between those two text tokens. Also wrapped the address value with single quotes. Will this add any confusion for the caller? Or colon and `"Failed to parse address: $value` looks better? --- .../security/web/util/matcher/IpAddressMatcher.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/main/java/org/springframework/security/web/util/matcher/IpAddressMatcher.java b/web/src/main/java/org/springframework/security/web/util/matcher/IpAddressMatcher.java index a0e9409e631..3be7851094d 100644 --- a/web/src/main/java/org/springframework/security/web/util/matcher/IpAddressMatcher.java +++ b/web/src/main/java/org/springframework/security/web/util/matcher/IpAddressMatcher.java @@ -93,7 +93,7 @@ private InetAddress parseAddress(String address) { return InetAddress.getByName(address); } catch (UnknownHostException ex) { - throw new IllegalArgumentException("Failed to parse address" + address, ex); + throw new IllegalArgumentException("Failed to parse address '" + address + "'", ex); } }