[prev in list] [next in list] [prev in thread] [next in thread] 

List:       httpclient-commons-dev
Subject:    [jira] [Commented] (HTTPCORE-714) URIBuilder incorrectly parses path with special characters
From:       "Michael Osipov (Jira)" <jira () apache ! org>
Date:       2022-05-30 19:33:00
Message-ID: JIRA.13447563.1653934780000.159652.1653939180011 () Atlassian ! JIRA
[Download RAW message or body]


    [ https://issues.apache.org/jira/browse/HTTPCORE-714?page=com.atlassian.jira.plugi \
n.system.issuetabpanels:comment-tabpanel&focusedCommentId=17544042#comment-17544042 ] \


Michael Osipov commented on HTTPCORE-714:
-----------------------------------------

Forget {{java.net.URI}}, it is broken. Your input is broken. It has to be \
URI-encoded.

> 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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic