-
Notifications
You must be signed in to change notification settings - Fork 40.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Default CharacterEncodingFilter not ordered correctly #2148
Comments
odrotbohm
added a commit
to st-tu-dresden/salespoint
that referenced
this issue
Dec 15, 2014
Reintroduced the bean definition for the CharacterEncodingFilter as the default registered since Boot 1.2 does not get registered first (see spring-projects/spring-boot#2148 for details.
odrotbohm
added a commit
to st-tu-dresden/salespoint
that referenced
this issue
Dec 15, 2014
Reintroduced the bean definition for the CharacterEncodingFilter as the default registered since Boot 1.2 does not get registered first (see spring-projects/spring-boot#2148 for details.
odrotbohm
added a commit
to st-tu-dresden/salespoint
that referenced
this issue
Jan 8, 2015
The upgrade to Spring Boot 1.2.1 allows us to finally get rid off the bean definition for CharacterEncodingFilter as the one defaulted by Boot now works as advertised. Related tickets: #81, spring-projects/spring-boot#2148.
odrotbohm
added a commit
to st-tu-dresden/salespoint
that referenced
this issue
Jan 8, 2015
The upgrade to Spring Boot 1.2.1 allows us to finally get rid off the bean definition for CharacterEncodingFilter as the one defaulted by Boot now works as advertised. Related tickets: #81, spring-projects/spring-boot#2148.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As of 1.2.0 Boot ships with a default
CharacterEncodingFilter
registered byHttpEncodingAutoConfiguration
. The bean definition for that is annotated with@Order(Ordered.HIGHEST_PRECEDENCE)
but unfortunately this declaration never gets evaluated as the component triggering the sorting only acts on the bean instance (seeServletContextInitializerBeans.addAsRegistrationBean(…)
for the relevant code section).This causes issues with the
HiddenHttpMethodFilter
. If this one is registered first, it already accesses the request parameters before the encoding is enforced by theCharacterEncodingFilter
and the request data is already in the wrong format.Generally speaking, I don't think
@Order(…)
annotations are supported on bean definitions as theBeanDefinition
API doesn't allow configuring an order programatically.I think a workaround would be to create a custom sub-class that additionally implements
Ordered
and returnsOrdered.HIGHEST_PRECEDENCE
for the calls togetOrder()
.The text was updated successfully, but these errors were encountered: