Gargi-jais11 commented on code in PR #10586:
URL: https://github.com/apache/ozone/pull/10586#discussion_r3490105640
##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/util/S3Utils.java:
##########
@@ -62,6 +62,17 @@ public static String urlEncode(String str)
return URLEncoder.encode(str, UTF_8.name());
}
+ /**
+ * Percent-encode a string for S3 {@code encoding-type=url} responses.
+ *
+ * <p>Unlike {@link URLEncoder} (application/x-www-form-urlencoded), AWS S3
+ * uses percent-encoding where spaces are {@code %20}, not {@code +}.
+ */
+ public static String s3urlEncode(String str)
+ throws UnsupportedEncodingException {
+ return urlEncode(str).replace("+", "%20");
+ }
Review Comment:
@adoroszlai I need to determine whether `PercentCodec` produces the same
encoding semantics that AWS S3 expects. Currently I am gong through some of the
documentation. If there is no issue then I will update it.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]