You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by "Siqi Li (Jira)" <ji...@apache.org> on 2022/05/30 20:23:00 UTC
[jira] [Closed] (HTTPCORE-714) URIBuilder incorrectly parses path with special characters
[ https://issues.apache.org/jira/browse/HTTPCORE-714?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Siqi Li closed HTTPCORE-714.
----------------------------
Resolution: Not A Problem
> URIBuilder incorrectly parses path with special characters
> ----------------------------------------------------------
>
> Key: HTTPCORE-714
> URL: https://issues.apache.org/jira/browse/HTTPCORE-714
> Project: HttpComponents HttpCore
> Issue Type: Bug
> Components: HttpCore
> Affects Versions: 5.1.2
> Reporter: Siqi Li
> Priority: Minor
>
> Code sample:
> {code:java}
> public static void main(String[] args) throws Exception {
> System.out.println(new java.net.URI("http://example.com/🙈").getPath()); // Prints /🙈
> System.out.println(new URIBuilder("http://example.com/" + java.net.URLEncoder.encode("🙈", "UTF-8")).getPath()); // Prints /🙈
> System.out.println(new URIBuilder().setPathSegments(Collections.singletonList("🙈")).getPath()); // Prints /🙈
> System.out.println(new URIBuilder().setPath("/🙈").getPath()); // Prints /🙈
> System.out.println(new URIBuilder("http://example.com/🙈").getPath()); // Prints /=H
> }{code}
> In the last example, URIBuilder seems to have turned "/🙈" into "/=H".
--
This message was sent by Atlassian Jira
(v8.20.7#820007)
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org