Siqi Li created HTTPCORE-714:
--------------------------------
Summary: 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
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: [email protected]
For additional commands, e-mail: [email protected]