File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed
src/main/java/io/apitally/spring Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ public ApitallyFilter(ApitallyClient client) {
42
42
@ Override
43
43
protected void doFilterInternal (@ NonNull HttpServletRequest request , @ NonNull HttpServletResponse response ,
44
44
@ NonNull FilterChain filterChain ) throws ServletException , IOException {
45
- if (!client .isEnabled ()) {
45
+ if (!client .isEnabled () || request . getMethod (). equals ( "OPTIONS" ) ) {
46
46
filterChain .doFilter (request , response );
47
47
return ;
48
48
}
Original file line number Diff line number Diff line change 6
6
7
7
import org .springframework .boot .SpringBootVersion ;
8
8
import org .springframework .core .SpringVersion ;
9
+ import org .springframework .web .bind .annotation .RequestMethod ;
9
10
import org .springframework .web .servlet .mvc .condition .PathPatternsRequestCondition ;
10
11
import org .springframework .web .servlet .mvc .condition .PatternsRequestCondition ;
11
12
import org .springframework .web .servlet .mvc .method .RequestMappingInfo ;
@@ -19,6 +20,7 @@ public static List<Path> getPaths(RequestMappingHandlerMapping requestMappingHan
19
20
.flatMap (entry -> {
20
21
RequestMappingInfo mappingInfo = entry .getKey ();
21
22
return mappingInfo .getMethodsCondition ().getMethods ().stream ()
23
+ .filter (method -> method != RequestMethod .OPTIONS && method != RequestMethod .HEAD )
22
24
.flatMap (method -> {
23
25
PathPatternsRequestCondition pathPatterns = mappingInfo .getPathPatternsCondition ();
24
26
if (pathPatterns != null && pathPatterns .getPatterns () != null ) {
You can’t perform that action at this time.
0 commit comments