java.lang.Object
io.helidon.http.HostValidator
Validate the host string (maybe from the
Host
header).
Validation is based on RFC-3986.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Validate a host string.static void
validateIpLiteral
(String ipLiteral) An IP literal starts with[
and ends with]
.static void
validateNonIpLiteral
(String host) Validate IPv4 address or a registered name.
-
Method Details
-
validate
Validate a host string.- Parameters:
host
- host to validate- Throws:
IllegalArgumentException
- in case the host is not valid, the message is HTML encoded
-
validateIpLiteral
An IP literal starts with[
and ends with]
.- Parameters:
ipLiteral
- host literal string, may be an IPv6 address, or IP version future- Throws:
IllegalArgumentException
- in case the host is not valid, the message is HTML encoded
-
validateNonIpLiteral
Validate IPv4 address or a registered name.- Parameters:
host
- string with either an IPv4 address, or a registered name- Throws:
IllegalArgumentException
- in case the host is not valid, the message is HTML encoded
-