Skip to content

Disable auto-configuration of HiddenHttpMethodFilter by default #16953

@vpavic

Description

@vpavic

WebMvcAutoConfiguration currently configures a lot of components that are specific to use of Spring MVC with a templating engine to produce server-side generated text/html content. An example of this is HiddenHttpMethodFilter, which is enabled by default. Such components present an unnecessary overhead when Spring MVC is solely used to produce e.g. application/json based APIs.

This has caught my attention after we discovered that the aforementioned HiddenHttpMethodFilter has been taking up to 80% of processing time on certain endpoints. While it was simple enough to disable the filter using spring.mvc.hiddenmethod.filter.enabled property, you have to do it in each project and I believe configuration could be made more lightweight there. In the case of this particular filter, a case could be made that it's not really needed even in all projects that use a templating engine.

Metadata

Metadata

Assignees

Labels

type: blockerAn issue that is blocking us from releasingtype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions