Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
d22c3e27
Commit
d22c3e27
authored
Aug 17, 2018
by
artsiom
Committed by
Brian Clozel
Aug 17, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add property to disable HiddenHttpMethodFilter
Closes gh-14030
parent
4bc5535c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
0 deletions
+25
-0
WebMvcAutoConfiguration.java
...ot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java
+2
-0
additional-spring-configuration-metadata.json
...es/META-INF/additional-spring-configuration-metadata.json
+6
-0
WebMvcAutoConfigurationTests.java
...toconfigure/web/servlet/WebMvcAutoConfigurationTests.java
+16
-0
appendix-application-properties.adoc
...cs/src/main/asciidoc/appendix-application-properties.adoc
+1
-0
No files found.
spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration.java
View file @
d22c3e27
...
...
@@ -135,6 +135,7 @@ import org.springframework.web.servlet.view.InternalResourceViewResolver;
* @author Stephane Nicoll
* @author Kristine Jetzke
* @author Bruce Brouwer
* @author Artsiom Yudovin
*/
@Configuration
@ConditionalOnWebApplication
(
type
=
Type
.
SERVLET
)
...
...
@@ -153,6 +154,7 @@ public class WebMvcAutoConfiguration {
@Bean
@ConditionalOnMissingBean
(
HiddenHttpMethodFilter
.
class
)
@ConditionalOnProperty
(
prefix
=
"spring.mvc.hiddenmethod.filter"
,
name
=
"enabled"
,
matchIfMissing
=
true
)
public
OrderedHiddenHttpMethodFilter
hiddenHttpMethodFilter
()
{
return
new
OrderedHiddenHttpMethodFilter
();
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/main/resources/META-INF/additional-spring-configuration-metadata.json
View file @
d22c3e27
...
...
@@ -466,6 +466,12 @@
"description"
:
"Whether to enable Spring's HttpPutFormContentFilter."
,
"defaultValue"
:
true
},
{
"name"
:
"spring.mvc.hiddenmethod.filter.enabled"
,
"type"
:
"java.lang.Boolean"
,
"description"
:
"Whether to enable Spring's HiddenHttpMethodFilter."
,
"defaultValue"
:
true
},
{
"name"
:
"spring.mvc.media-types"
,
"type"
:
"java.util.Map<java.lang.String,org.springframework.http.MediaType>"
,
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfigurationTests.java
View file @
d22c3e27
...
...
@@ -71,6 +71,7 @@ import org.springframework.web.accept.ParameterContentNegotiationStrategy;
import
org.springframework.web.accept.PathExtensionContentNegotiationStrategy
;
import
org.springframework.web.bind.support.ConfigurableWebBindingInitializer
;
import
org.springframework.web.context.request.ServletWebRequest
;
import
org.springframework.web.filter.HiddenHttpMethodFilter
;
import
org.springframework.web.filter.HttpPutFormContentFilter
;
import
org.springframework.web.servlet.HandlerAdapter
;
import
org.springframework.web.servlet.HandlerExceptionResolver
;
...
...
@@ -118,6 +119,7 @@ import static org.mockito.Mockito.mock;
* @author Brian Clozel
* @author Eddú Meléndez
* @author Kristine Jetzke
* @author Artsiom Yudovin
*/
public
class
WebMvcAutoConfigurationTests
{
...
...
@@ -572,6 +574,20 @@ public class WebMvcAutoConfigurationTests {
.
doesNotHaveBean
(
HttpPutFormContentFilter
.
class
));
}
@Test
public
void
hiddenHttpMethodFilterCanBeDisabled
()
{
this
.
contextRunner
.
withPropertyValues
(
"spring.mvc.hiddenmethod.filter.enabled=false"
)
.
run
((
context
)
->
assertThat
(
context
)
.
doesNotHaveBean
(
HiddenHttpMethodFilter
.
class
));
}
@Test
public
void
hiddenHttpMethodFilterEnabledByDefault
()
{
this
.
contextRunner
.
run
((
context
)
->
assertThat
(
context
)
.
hasSingleBean
(
HiddenHttpMethodFilter
.
class
));
}
@Test
public
void
customConfigurableWebBindingInitializer
()
{
this
.
contextRunner
...
...
spring-boot-project/spring-boot-docs/src/main/asciidoc/appendix-application-properties.adoc
View file @
d22c3e27
...
...
@@ -429,6 +429,7 @@ content into your application. Rather, pick only the properties that you need.
spring.mvc.dispatch-options-request=true # Whether to dispatch OPTIONS requests to the FrameworkServlet doService method.
spring.mvc.favicon.enabled=true # Whether to enable resolution of favicon.ico.
spring.mvc.formcontent.putfilter.enabled=true # Whether to enable Spring's HttpPutFormContentFilter.
spring.mvc.hiddenmethod.filter.enabled=true # Whether to enable Spring's HiddenHttpMethodFilter.
spring.mvc.ignore-default-model-on-redirect=true # Whether the content of the "default" model should be ignored during redirect scenarios.
spring.mvc.locale= # Locale to use. By default, this locale is overridden by the "Accept-Language" header.
spring.mvc.locale-resolver=accept-header # Define how the locale should be resolved.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment