InetEndpoint: properly match IPv6 addresses
The old one didn't account for trailing digits. Reported-by: Brandon Jackson <bjackson@napshome.net> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
parent
c4ba48d7a9
commit
76305045db
@ -26,7 +26,7 @@ import java9.util.Optional;
|
|||||||
* Instances of this class are externally immutable.
|
* Instances of this class are externally immutable.
|
||||||
*/
|
*/
|
||||||
public final class InetEndpoint {
|
public final class InetEndpoint {
|
||||||
private static final Pattern BARE_IPV6 = Pattern.compile("^[^\\[]*:");
|
private static final Pattern BARE_IPV6 = Pattern.compile("^[^\\[\\]]*:[^\\[\\]]*");
|
||||||
private static final Pattern FORBIDDEN_CHARACTERS = Pattern.compile("[/?#]");
|
private static final Pattern FORBIDDEN_CHARACTERS = Pattern.compile("[/?#]");
|
||||||
|
|
||||||
private final String host;
|
private final String host;
|
||||||
|
Loading…
Reference in New Issue
Block a user