return false;
}
private void addHistory(HttpMessage msg, int type) {
HistoryReference historyRef = null;
try {
historyRef = new HistoryReference(model.getSession(), type, msg);
} catch (Exception e) {
// ZAP: Log exceptions
log.warn(e.getMessage(), e);
return;
}
if (type != HistoryReference.TYPE_MANUAL && type != HistoryReference.TYPE_HIDDEN) {
return;
}
// add history to list (log panel). Must use event queue because this
// proxylistener may not be run from event queue.
// TODO: AXEL... This code is really dirty... please cleanup
synchronized (historyList) {
if (type == HistoryReference.TYPE_MANUAL) {
if (pattern == null && historyFilter == null) {
addHistoryInEventQueue(historyRef);
} else if (historyFilter != null) {
if (historyFilter.matches(historyRef)) {
addHistoryInEventQueue(historyRef);
}
} else {
StringBuffer sb = new StringBuffer();
sb.append(msg.getRequestHeader().toString());
sb.append(msg.getRequestBody().toString());
if (!msg.getResponseHeader().isEmpty()) {
sb.append(msg.getResponseHeader().toString());
sb.append(msg.getResponseBody().toString());
}
if (pattern.matcher(sb.toString()).find()) {
addHistoryInEventQueue(historyRef);
}
}
//TODO: Old Andiparos Code
/*
String uri = msg.getRequestHeader().getURI().toString();
if (uriFilterPattern != null && pattern != null) {
if (uriFilterPattern.matcher(uri).find() && ifHeaderPatternMatches(msg, historyRef)) {
addHistoryInEventQueue(historyRef);
}
} else if (uriFilterPattern != null) {
if (uriFilterPattern.matcher(uri).find()) {
addHistoryInEventQueue(historyRef);
}
} else if (pattern != null) {
if (ifHeaderPatternMatches(msg, historyRef)) {
addHistoryInEventQueue(historyRef);
}
} else {
addHistoryInEventQueue(historyRef);
}*/
}
}
// add history to site panel. Must use event queue because this
// proxylistener may not be run from event queue.
final HistoryReference ref = historyRef;
final HttpMessage finalMsg = msg;
if (EventQueue.isDispatchThread()) {
model.getSession().getSiteTree().addPath(ref, msg);
if (isFirstAccess) {
isFirstAccess = false;