michael-o commented on a change in pull request #274:
URL:
https://github.com/apache/httpcomponents-core/pull/274#discussion_r602081091
##########
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:
As for `[::1]` and `::1`. RFC 8200 nowhere mentions the brackets. They
are used in URIs to avoid parsing errors. Same in `httpd.conf` and
`sshd_config`, etc. We have to differentionate between host subcomponent and
host actually. The subcomponent of course can contain brackets and
percent-encoded content while the actual reg-name does not. The host production
applies to host subcomponents under the restrictions of the URI production only.
From an API point of view the client does not care about the internal
encoding of the builder, but provides raw values, the builder needs to take
care. So have the getter work, return Java strings and not escaped ones.
This is my understanding of the host value. I am certain that this is
disputed. Maybe one should inquire with the WG.
--
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]