Parcourir la source

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?
cyb3r4nt il y a 3 ans
Parent
commit
1d555b62e3

+ 1 - 1
web/src/main/java/org/springframework/security/web/util/matcher/IpAddressMatcher.java

@@ -93,7 +93,7 @@ public final class IpAddressMatcher implements RequestMatcher {
 			return InetAddress.getByName(address);
 			return InetAddress.getByName(address);
 		}
 		}
 		catch (UnknownHostException ex) {
 		catch (UnknownHostException ex) {
-			throw new IllegalArgumentException("Failed to parse address" + address, ex);
+			throw new IllegalArgumentException("Failed to parse address '" + address + "'", ex);
 		}
 		}
 	}
 	}