DaanHoogland commented on code in PR #6393:
URL: https://github.com/apache/cloudstack/pull/6393#discussion_r876834139
##########
server/src/main/java/com/cloud/api/ApiServlet.java:
##########
@@ -186,22 +190,28 @@ void processRequestInContext(final HttpServletRequest
req, final HttpServletResp
}
try {
-
- if (HttpUtils.RESPONSE_TYPE_JSON.equalsIgnoreCase(responseType)) {
- resp.setContentType(ApiServer.JSONcontentType.value());
- } else if
(HttpUtils.RESPONSE_TYPE_XML.equalsIgnoreCase(responseType)){
- resp.setContentType(HttpUtils.XML_CONTENT_TYPE);
- }
+ resp.setContentType(HttpUtils.XML_CONTENT_TYPE);
HttpSession session = req.getSession(false);
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace(String.format("session found: %s", session));
+ }
final Object[] responseTypeParam =
params.get(ApiConstants.RESPONSE);
if (responseTypeParam != null) {
responseType = (String)responseTypeParam[0];
}
final Object[] commandObj = params.get(ApiConstants.COMMAND);
- if (commandObj != null) {
- final String command = (String) commandObj[0];
+ final String command = commandObj == null ? null : (String)
commandObj[0];
+ final Object[] userObj = params.get(ApiConstants.USERNAME);
+ String username = userObj == null ? null : (String)userObj[0];
+ if (s_logger.isTraceEnabled()) {
+ s_logger.trace(String.format("command %s processing for user
\"%s\"", command, username));
Review Comment:
```suggestion
s_logger.trace(String.format("command %s processing for user
\"%s\"", command, username.replaceAll("[\n\r\t]", "_")));
```
--
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]