[ 
https://issues.apache.org/jira/browse/HTTPCORE-671?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314929#comment-17314929
 ] 

ASF subversion and git services commented on HTTPCORE-671:
----------------------------------------------------------

Commit 89e0d3ed0f2ccecd92c5b857a1429615a7cea7a4 in httpcomponents-core's branch 
refs/heads/master from Carter Kozak
[ https://gitbox.apache.org/repos/asf?p=httpcomponents-core.git;h=89e0d3e ]

HTTPCORE-671: URIBuilder does not precent-encode bracketed IPv6 addresses

URIBuilder complies with https://tools.ietf.org/html/rfc3986


> URIBuilder incorrectly percent-encodes bracketed ipv6 addresses
> ---------------------------------------------------------------
>
>                 Key: HTTPCORE-671
>                 URL: https://issues.apache.org/jira/browse/HTTPCORE-671
>             Project: HttpComponents HttpCore
>          Issue Type: New Feature
>          Components: HttpCore
>    Affects Versions: 5.1
>            Reporter: Carter Kozak
>            Assignee: Carter Kozak
>            Priority: Major
>          Time Spent: 6h 40m
>  Remaining Estimate: 0h
>
> {code:java}
> new URIBuilder("https://[::1]:432/path";).build();
> Correctly produces 'https://[::1]:432/path'{code}
> {code:java}
> new URIBuilder("https://[::1]:432/path";).setPort(123).build();
> Incorrectly produces 'https://%5B%3A%3A1%5D:123/path'
> where the resulting uri.getPort is -1 and uri.getHost() is null.
> {code}
> The second example fails because we skip the fast path that preserves input 
> data when mutations are made.
> I think we need to check for the existence of 
> [https://tools.ietf.org/html/rfc2732] brackets in a third branch: 
> [https://github.com/apache/httpcomponents-core/blob/cfb6871bd84e0f17068dea1c17d05b848c02ea69/httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java#L293-L297]
>  
> Alternatively we could strip brackets when we decode/store the host value in 
> URIBuilder, however the 'getHost' result might be confusing.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org
For additional commands, e-mail: dev-h...@hc.apache.org

Reply via email to