mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Make GzipFilterAutoConfiguration conditional on HttpMethod
GzipFilterProperties uses HttpMethod so GzipFilterAutoConfiguration, which uses GzipFilterProperties, needs to be conditional on HttpMethod being on the classpath. Closes gh-3362
This commit is contained in:
parent
76348e50e6
commit
5a1e66b3d6
@ -25,6 +25,7 @@ import org.springframework.boot.context.embedded.FilterRegistrationBean;
|
|||||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||||
import org.springframework.context.annotation.Bean;
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.http.HttpMethod;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@link EnableAutoConfiguration Auto-configuration} for {@link GzipFilter}.
|
* {@link EnableAutoConfiguration Auto-configuration} for {@link GzipFilter}.
|
||||||
@ -33,7 +34,7 @@ import org.springframework.context.annotation.Configuration;
|
|||||||
* @since 1.2.2
|
* @since 1.2.2
|
||||||
*/
|
*/
|
||||||
@Configuration
|
@Configuration
|
||||||
@ConditionalOnClass(GzipFilter.class)
|
@ConditionalOnClass({ GzipFilter.class, HttpMethod.class })
|
||||||
@EnableConfigurationProperties(GzipFilterProperties.class)
|
@EnableConfigurationProperties(GzipFilterProperties.class)
|
||||||
public class GzipFilterAutoConfiguration {
|
public class GzipFilterAutoConfiguration {
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user