ok2c commented on code in PR #517: URL: https://github.com/apache/httpcomponents-core/pull/517#discussion_r1995772108
########## httpcore5/src/main/java/org/apache/hc/core5/net/URIBuilder.java: ########## @@ -391,14 +438,16 @@ private String buildString() { formatQuery(sb, this.queryParams, this.charset, false); } else if (this.query != null) { sb.append("?"); - PercentCodec.encode(sb, this.query, this.charset, PercentCodec.URIC, false); + PercentCodec.encode(sb, this.query, this.charset, + encodingPolicy == EncodingPolicy.ALL_RESERVED ? PercentCodec.URIC : PercentCodec.QUERY, false); } } if (this.encodedFragment != null) { sb.append("#").append(this.encodedFragment); } else if (this.fragment != null) { sb.append("#"); - PercentCodec.encode(sb, this.fragment, this.charset, PercentCodec.URIC, false); + PercentCodec.encode(sb, this.fragment, this.charset, + encodingPolicy == EncodingPolicy.ALL_RESERVED ? PercentCodec.UNRESERVED : PercentCodec.FRAGMENT, false); Review Comment: @arturobernalg We should use `URIC` here for consistency with the latest changes in 5.3.x -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@hc.apache.org For additional commands, e-mail: dev-h...@hc.apache.org