mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-08-29 03:06:45 +08:00
Allow HttpPutFormContentFilter to be disabled
Add `spring.mvc.formcontent.putfilter.enabled` property to allow the HttpPutFormContentFilter to be disabled. Fixes gh-6519
This commit is contained in:
parent
a2e4127d4f
commit
b97e0bd471
@ -122,6 +122,7 @@ public class WebMvcAutoConfiguration {
|
|||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
@ConditionalOnMissingBean(HttpPutFormContentFilter.class)
|
@ConditionalOnMissingBean(HttpPutFormContentFilter.class)
|
||||||
|
@ConditionalOnProperty(prefix = "spring.mvc.formcontent.putfilter", name = "enabled", matchIfMissing = true)
|
||||||
public OrderedHttpPutFormContentFilter httpPutFormContentFilter() {
|
public OrderedHttpPutFormContentFilter httpPutFormContentFilter() {
|
||||||
return new OrderedHttpPutFormContentFilter();
|
return new OrderedHttpPutFormContentFilter();
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,12 @@
|
|||||||
"description": "Enable resolution of favicon.ico.",
|
"description": "Enable resolution of favicon.ico.",
|
||||||
"defaultValue": true
|
"defaultValue": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "spring.mvc.formcontent.putfilter.enabled",
|
||||||
|
"type": "java.lang.Boolean",
|
||||||
|
"description": "Enable Spring's HttpPutFormContentFilter.",
|
||||||
|
"defaultValue": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "spring.rabbitmq.dynamic",
|
"name": "spring.rabbitmq.dynamic",
|
||||||
"type": "java.lang.Boolean",
|
"type": "java.lang.Boolean",
|
||||||
|
@ -476,6 +476,13 @@ public class WebMvcAutoConfigurationTests {
|
|||||||
is(equalTo(1)));
|
is(equalTo(1)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void httpPutFormContentFilterCanBeDisabled() throws Exception {
|
||||||
|
load((Class<?>) null, "spring.mvc.formcontent.putfilter.enabled=false");
|
||||||
|
assertThat(this.context.getBeansOfType(HttpPutFormContentFilter.class).size(),
|
||||||
|
is(equalTo(0)));
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void customConfigurableWebBindingInitializer() {
|
public void customConfigurableWebBindingInitializer() {
|
||||||
load(CustomConfigurableWebBindingInitializer.class);
|
load(CustomConfigurableWebBindingInitializer.class);
|
||||||
|
@ -307,6 +307,7 @@ content into your application; rather pick only the properties that you need.
|
|||||||
spring.mvc.dispatch-trace-request=false # Dispatch TRACE requests to the FrameworkServlet doService method.
|
spring.mvc.dispatch-trace-request=false # Dispatch TRACE requests to the FrameworkServlet doService method.
|
||||||
spring.mvc.dispatch-options-request=false # Dispatch OPTIONS requests to the FrameworkServlet doService method.
|
spring.mvc.dispatch-options-request=false # Dispatch OPTIONS requests to the FrameworkServlet doService method.
|
||||||
spring.mvc.favicon.enabled=true # Enable resolution of favicon.ico.
|
spring.mvc.favicon.enabled=true # Enable resolution of favicon.ico.
|
||||||
|
spring.mvc.formcontent.putfilter.enabled=true # Enable Spring's HttpPutFormContentFilter.
|
||||||
spring.mvc.ignore-default-model-on-redirect=true # If the content of the "default" model should be ignored during redirect scenarios.
|
spring.mvc.ignore-default-model-on-redirect=true # If the content of the "default" model should be ignored during redirect scenarios.
|
||||||
spring.mvc.locale= # Locale to use.
|
spring.mvc.locale= # Locale to use.
|
||||||
spring.mvc.media-types.*= # Maps file extensions to media types for content negotiation.
|
spring.mvc.media-types.*= # Maps file extensions to media types for content negotiation.
|
||||||
|
Loading…
Reference in New Issue
Block a user