I am working on a Java Spring project and we wrote an Interceptor for security. This class implements WebMvcConfigurer, and we override the addInterceptors method:
@Override
public void addInterceptors(InterceptorRegistry registry) {
registry.addInterceptor(new SecurityInterceptor(aService, sService))
.excludePathPatterns("/", "/ping", "/resc")
}
This works nicely. Now, the path "/resc" has a GET request but also a POST request. The point is the POST request must be intercepted and GET request to same path not.
Is there a way to achieve that? Thanks