michael-o commented on a change in pull request #274:
URL:
https://github.com/apache/httpcomponents-core/pull/274#discussion_r602077643
##########
File path: httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java
##########
@@ -292,6 +292,8 @@ private String buildString() {
}
if (InetAddressUtils.isIPv6Address(this.host)) {
sb.append("[").append(this.host).append("]");
+ } else if
(InetAddressUtils.isIPv6URLBracketedAddress(this.host)) {
Review comment:
First of all `%3A%3A1` is invalid. See the production for the host
components:
> host = IP-literal / IPv4address / reg-name
Neither `IP-literal`, nor `IPv4address` allow PCT encoded so these
productions are skipped. Remains `reg-name`:
> reg-name = *( unreserved / pct-encoded / sub-delims )
So colon matches to `pct-encoded`, but represents an illegal hostname.
Also note:
> This syntax does not support IPv6 scoped addressing zone identifiers.
Also this one:
> The syntax rule for host is ambiguous because it does not completely
distinguish between an IPv4address and a reg-name. In order to
disambiguate the syntax, we apply the "first-match-wins" algorithm:
If host matches the rule for IPv4address, then it should be
considered an IPv4 address literal and not a reg-name.
Thanks my understanding of the RFC.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]