Version: 3.4 Update
This commit is contained in:
@@ -32,9 +32,6 @@ public class HttpMessagePassiveHandler implements ScanCheck {
|
|||||||
private final MessageTableModel messageTableModel;
|
private final MessageTableModel messageTableModel;
|
||||||
private final MessageProcessor messageProcessor;
|
private final MessageProcessor messageProcessor;
|
||||||
|
|
||||||
private final List<String> colorList = new ArrayList<>();
|
|
||||||
private final List<String> commentList = new ArrayList<>();
|
|
||||||
|
|
||||||
public HttpMessagePassiveHandler(MontoyaApi api, ConfigLoader configLoader, MessageTableModel messageTableModel) {
|
public HttpMessagePassiveHandler(MontoyaApi api, ConfigLoader configLoader, MessageTableModel messageTableModel) {
|
||||||
this.api = api;
|
this.api = api;
|
||||||
this.configLoader = configLoader;
|
this.configLoader = configLoader;
|
||||||
@@ -50,6 +47,9 @@ public class HttpMessagePassiveHandler implements ScanCheck {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public AuditResult passiveAudit(HttpRequestResponse httpRequestResponse) {
|
public AuditResult passiveAudit(HttpRequestResponse httpRequestResponse) {
|
||||||
|
List<String> colorList = new ArrayList<>();
|
||||||
|
List<String> commentList = new ArrayList<>();
|
||||||
|
|
||||||
HttpRequest request = httpRequestResponse.request();
|
HttpRequest request = httpRequestResponse.request();
|
||||||
HttpResponse response = httpRequestResponse.response();
|
HttpResponse response = httpRequestResponse.response();
|
||||||
|
|
||||||
@@ -58,8 +58,8 @@ public class HttpMessagePassiveHandler implements ScanCheck {
|
|||||||
if (!matches) {
|
if (!matches) {
|
||||||
try {
|
try {
|
||||||
String host = StringProcessor.getHostByUrl(request.url());
|
String host = StringProcessor.getHostByUrl(request.url());
|
||||||
setColorAndCommentList(messageProcessor.processRequest(host, request, true));
|
setColorAndCommentList(messageProcessor.processRequest(host, request, true), colorList, commentList);
|
||||||
setColorAndCommentList(messageProcessor.processResponse(host, response, true));
|
setColorAndCommentList(messageProcessor.processResponse(host, response, true), colorList, commentList);
|
||||||
|
|
||||||
String url = request.url();
|
String url = request.url();
|
||||||
String method = request.method();
|
String method = request.method();
|
||||||
@@ -83,7 +83,7 @@ public class HttpMessagePassiveHandler implements ScanCheck {
|
|||||||
return auditResult(emptyList());
|
return auditResult(emptyList());
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setColorAndCommentList(List<Map<String, String>> result) {
|
private void setColorAndCommentList(List<Map<String, String>> result, List<String> colorList, List<String> commentList) {
|
||||||
if (result != null && !result.isEmpty()) {
|
if (result != null && !result.isEmpty()) {
|
||||||
colorList.add(result.get(0).get("color"));
|
colorList.add(result.get(0).get("color"));
|
||||||
commentList.add(result.get(1).get("comment"));
|
commentList.add(result.get(1).get("comment"));
|
||||||
|
|||||||
Reference in New Issue
Block a user