neils-dev commented on code in PR #3726:
URL: https://github.com/apache/ozone/pull/3726#discussion_r958980257


##########
hadoop-ozone/s3gateway/src/main/java/org/apache/hadoop/ozone/s3/signature/StringToSignProducer.java:
##########
@@ -249,6 +249,7 @@ private static String urlEncode(String str) {
     try {
       return S3Utils.urlEncode(str)
           .replaceAll("\\+", "%20")
+          .replaceAll("\\*", "%2A")
           .replaceAll("%7E", "~");
     } catch (UnsupportedEncodingException e) {

Review Comment:
   @symious thanks.  I checked with aws `botocore` for encoding the URI for the 
signature.  It looks like the `StringToSignProducer` encoder is equivalent now 
to aws `botocore`.  Which should be fine.  It is a python implementation that 
uses `urllib`.`quote`.
   
https://github.com/boto/botocore/blob/f2b0dbb800b8dc2a3541334d5ca1190faf900150/botocore/auth.py#L362
   
   Within quote its safe characters are : Letters, digits, and the characters 
'_.-~'  as well as user added '/\~' .
   https://docs.python.org/3/library/urllib.parse.html
   
   If we are compatible with this then we should not have any unexpected 
problems.
   With  the java class `java.net.URLEncoder,` the safe characters include in 
addition to the urllib.parse.quote safe characters  just "*".   Please check 
this as well.
   https://docs.oracle.com/javase/1.5.0/docs/api/java/net/URLEncoder.html



-- 
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]

Reply via email to