Skip to content

Commit 4502150

Browse files
committed
修复已知bug
1 parent f72c55b commit 4502150

File tree

2 files changed

+4
-9
lines changed

2 files changed

+4
-9
lines changed

src/main/java/com/chave/editor/RequestEditor.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import com.chave.pojo.APIItem;
1313
import com.chave.service.APIMatchService;
1414
import com.chave.service.SensitiveInfoMatchService;
15+
import com.chave.utils.Util;
1516

1617
import javax.swing.*;
1718
import javax.swing.table.DefaultTableCellRenderer;
@@ -33,7 +34,6 @@ public ExtensionProvidedHttpRequestEditor provideHttpRequestEditor(EditorCreatio
3334
private static class Editor implements ExtensionProvidedHttpRequestEditor {
3435
private HttpRequestResponse requestResponse;
3536
private final JTabbedPane jTabbedPane = new JTabbedPane();
36-
private APIMatchService apiMatchService = new APIMatchService();
3737
private SensitiveInfoMatchService sensitiveInfoMatchService = new SensitiveInfoMatchService();
3838

3939
public Editor() {
@@ -53,8 +53,7 @@ public void setRequestResponse(HttpRequestResponse requestResponse) {
5353
public boolean isEnabledFor(HttpRequestResponse requestResponse) {
5454
HttpRequest request = requestResponse.request();
5555
try {
56-
Method matchMethod = APIMatchService.class.getMethod(UserConfig.MATCH_MOD.name(), HttpRequest.class);
57-
HashMap apiMatchResult = (HashMap) matchMethod.invoke(apiMatchService, request);
56+
HashMap apiMatchResult = Util.getAPIMatchResult(request);
5857
boolean isMatched = (boolean) apiMatchResult.get("isMatched");
5958
if (isMatched && SensitiveInfoConfig.IS_CHECK_SENSITIVE_INFO) {
6059
HashMap result = sensitiveInfoMatchService.sensitiveInfoMatch(request);

src/main/java/com/chave/editor/ResponseEditor.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,15 @@
77
import burp.api.montoya.ui.editor.extension.*;
88
import com.chave.Main;
99
import com.chave.config.SensitiveInfoConfig;
10-
import com.chave.config.UserConfig;
11-
import com.chave.service.APIMatchService;
1210
import com.chave.service.SensitiveInfoMatchService;
11+
import com.chave.utils.Util;
1312

1413
import javax.swing.*;
1514
import javax.swing.table.DefaultTableCellRenderer;
1615
import javax.swing.table.DefaultTableModel;
1716
import javax.swing.table.JTableHeader;
1817
import javax.swing.table.TableCellRenderer;
1918
import java.awt.*;
20-
import java.lang.reflect.Method;
2119
import java.util.ArrayList;
2220
import java.util.HashMap;
2321
import java.util.Set;
@@ -32,7 +30,6 @@ public ExtensionProvidedHttpResponseEditor provideHttpResponseEditor(EditorCreat
3230
private static class Editor implements ExtensionProvidedHttpResponseEditor {
3331
private HttpRequestResponse requestResponse;
3432
private final JTabbedPane jTabbedPane = new JTabbedPane();
35-
private APIMatchService apiMatchService = new APIMatchService();
3633
private SensitiveInfoMatchService sensitiveInfoMatchService = new SensitiveInfoMatchService();
3734

3835
public Editor() {
@@ -53,8 +50,7 @@ public boolean isEnabledFor(HttpRequestResponse requestResponse) {
5350
HttpResponse response = requestResponse.response();
5451
HttpRequest request = requestResponse.request();
5552
try {
56-
Method matchMethod = APIMatchService.class.getMethod(UserConfig.MATCH_MOD.name(), HttpRequest.class);
57-
HashMap apiMatchResult = (HashMap) matchMethod.invoke(apiMatchService, request);
53+
HashMap apiMatchResult = Util.getAPIMatchResult(request);
5854
boolean isMatched = (boolean) apiMatchResult.get("isMatched");
5955
if (isMatched && SensitiveInfoConfig.IS_CHECK_SENSITIVE_INFO) {
6056
HashMap result = sensitiveInfoMatchService.sensitiveInfoMatch(response);

0 commit comments

Comments
 (0)