Skip to content

Commit 5d460c1

Browse files
committed
fix: spring mvc http method ignore trace
1 parent 68350ce commit 5d460c1

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

dongtai-api-gather/dongtai-api-gather-spring-api/src/main/java/io/dongtai/iast/api/gather/spring/convertor/RequestMappingInfoConvertor.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,15 @@ private void parseRequestMethodsRequestCondition(Path path) {
100100
Set<RequestMethod> methods = c.getMethods();
101101
// 如果此处默认为空的话,则将其扩展为所有的情况
102102
if (methods.isEmpty()) {
103-
methods = new HashSet<>(Arrays.asList(RequestMethod.values()));
103+
// 2023-7-4 12:31:06 默认情况下认为方法不映射trace
104+
methods = new HashSet<>(Arrays.asList(RequestMethod.GET,
105+
RequestMethod.HEAD,
106+
RequestMethod.POST,
107+
RequestMethod.PUT,
108+
RequestMethod.PATCH,
109+
RequestMethod.DELETE,
110+
RequestMethod.OPTIONS
111+
));
104112
}
105113
methods.forEach(new Consumer<RequestMethod>() {
106114
@Override
@@ -128,9 +136,10 @@ public void accept(RequestMethod requestMethod) {
128136
case OPTIONS:
129137
path.setOptions(operation);
130138
break;
131-
case TRACE:
132-
path.setTrace(operation);
133-
break;
139+
// 2023-7-4 12:30:52 忽略所有的trace方法
140+
// case TRACE:
141+
// path.setTrace(operation);
142+
// break;
134143
}
135144
}
136145
});

0 commit comments

Comments
 (0)