mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Make MetricFilter auto-configuration conditional on OncePerRequestFilter
In addition to requiring the Servlet API to be on the classpath, MetricFilter requires spring-web to also be on the classpath as it extends OncePerRequestFilter. This commit updates the auto-configuration for MetricFilter so that it will be disabled in the absence of a dependency on spring-web. Fixes gh-1664
This commit is contained in:
parent
d724c9062b
commit
e90c8548a2
@ -52,7 +52,8 @@ import org.springframework.web.util.UrlPathHelper;
|
||||
*/
|
||||
@Configuration
|
||||
@ConditionalOnBean({ CounterService.class, GaugeService.class })
|
||||
@ConditionalOnClass({ Servlet.class, ServletRegistration.class })
|
||||
@ConditionalOnClass({ Servlet.class, ServletRegistration.class,
|
||||
OncePerRequestFilter.class })
|
||||
@AutoConfigureAfter(MetricRepositoryAutoConfiguration.class)
|
||||
public class MetricFilterAutoConfiguration {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user