Skip to content

Commit

Permalink
Merge pull request #545 from CC11001100/develop
Browse files Browse the repository at this point in the history
fix: spring mvc http method ignore trace
  • Loading branch information
lostsnow authored Jul 4, 2023
2 parents 3b5e2ae + 5d460c1 commit d4a3ba3
Showing 1 changed file with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,15 @@ private void parseRequestMethodsRequestCondition(Path path) {
Set<RequestMethod> methods = c.getMethods();
// 如果此处默认为空的话,则将其扩展为所有的情况
if (methods.isEmpty()) {
methods = new HashSet<>(Arrays.asList(RequestMethod.values()));
// 2023-7-4 12:31:06 默认情况下认为方法不映射trace
methods = new HashSet<>(Arrays.asList(RequestMethod.GET,
RequestMethod.HEAD,
RequestMethod.POST,
RequestMethod.PUT,
RequestMethod.PATCH,
RequestMethod.DELETE,
RequestMethod.OPTIONS
));
}
methods.forEach(new Consumer<RequestMethod>() {
@Override
Expand Down Expand Up @@ -128,9 +136,10 @@ public void accept(RequestMethod requestMethod) {
case OPTIONS:
path.setOptions(operation);
break;
case TRACE:
path.setTrace(operation);
break;
// 2023-7-4 12:30:52 忽略所有的trace方法
// case TRACE:
// path.setTrace(operation);
// break;
}
}
});
Expand Down

0 comments on commit d4a3ba3

Please sign in to comment.