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 2021/06/09 20:31:00 UTC

[jira] [Created] (HTTPCORE-678) URIBuilder in 5.1 encodes more characters than necessary

Siqi Li created HTTPCORE-678:
--------------------------------

             Summary: URIBuilder in 5.1 encodes more characters than necessary
                 Key: HTTPCORE-678
                 URL: https://issues.apache.org/jira/browse/HTTPCORE-678
             Project: HttpComponents HttpCore
          Issue Type: Bug
          Components: HttpCore
    Affects Versions: 5.1
            Reporter: Siqi Li


Take this simple code example:
{code:java}
System.out.println(new URIBuilder().setScheme("https").setHost("example.com").setPathSegments("foo:bar").toString());
{code}
In 5.0 and in 4.x, this code would produce 
{code:java}
https://example.com/foo:bar
{code}
Since 5.1, the behavior has changed. It now produces
{code:java}
https://example.com/foo%3Abar
{code}
This actually broke one of my calls to iap.googleapis.com. I know it can be argued that it's the server's fault for not decoding %3A, but ':' does not actually need to be encoded in URL path segments. Also, this is an unnecessary breaking change in URIBuilder's behavior.



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

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