problem description
fortify tool scan prompt
the environmental background of the problems and what methods you have tried
Thecode is scanned by the customer headquarters using the fortify tool, and the scanning strategy is unknown.
related codes
public static String simpleHttpMapRequest(String location, Map requestMap) {
String resultString = "";
SslContextFactory sslContextFactory = new SslContextFactory();
HttpClient httpClient = new HttpClient(sslContextFactory);
try {
httpClient.start();
Request request = httpClient.POST(location);
if (requestMap != null) for (Object entryObj : requestMap.entrySet()) {
Map.Entry requestEntry = (Map.Entry) entryObj;
if(requestEntry!=null){
request.param(requestEntry.getKey() != null ? requestEntry.getKey().toString() : null,requestEntry.getValue() != null ? requestEntry.getValue().toString() : null);
}
}
ContentResponse response = request.send();
resultString = StringUtilities.toStringCleanBom(response.getContent());
} catch (Exception e) {
throw new BaseException("Error in http client request", e);
} finally {
try {
httpClient.stop();
} catch (Exception e) {
logger.error("Error stopping http client", e);
}
}
return resultString;
}
what result do you expect? What is the error message actually seen?
request.param(requestEntry.getKey() != null ? requestEntry.getKey().toString() : null,requestEntry.getValue() != null ? requestEntry.getValue().toString() : null);
I think there is no problem after checking it again and again with the context. Please take a look at it
.