Copilot commented on code in PR #11784:
URL: https://github.com/apache/cloudstack/pull/11784#discussion_r2405011501


##########
server/src/main/java/com/cloud/user/AccountManagerImpl.java:
##########
@@ -2990,7 +2989,7 @@ private UserAccount getUserAccountForSSO(String username, 
Long domainId, Map<Str
                     if (unsignedRequestBuffer.length() != 0) {
                         unsignedRequestBuffer.append("&");
                     }
-                    
unsignedRequestBuffer.append(paramName).append("=").append(URLEncoder.encode(paramValue,
 "UTF-8"));
+                    
unsignedRequestBuffer.append(paramName).append("=").append(URLEncoder.encode(paramValue,
 StringUtils.getPreferredCharset()));

Review Comment:
   URLEncoder.encode() expects a String for the charset parameter, but 
StringUtils.getPreferredCharset() likely returns a Charset object. This will 
cause a compilation error. Use StringUtils.getPreferredCharset().name() or 
Charset.toString() to get the string representation.
   ```suggestion
                       
unsignedRequestBuffer.append(paramName).append("=").append(URLEncoder.encode(paramValue,
 StringUtils.getPreferredCharset().name()));
   ```



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

Reply via email to