Closed ksambhav closed 7 years ago
AFAICT, that's a bug in Spring Cloud Netflix. It's calling ContentType.create("application/JSON;charset=UTF-8")
. If it wants to specify a charset, it should be calling the overloaded variant of that method that takes the charset as a separate argument. Can you please open an issue here for that? /cc @dsyer @spencergibb
As for why the charset is now there, I think that's a change in Spring Framework 4.3.6. @bclozel will know for sure.
The charset is, by default, par of the JSON media type as of SPR-13631 which was fixed with Spring Framework 4.3.0. So this change was shipped with the first Boot 1.4.x.
In a nutshell, many clients (including popular browsers) don't decode JSON properly if the encoding is not set in the content-type response header. The JSON spec says that the charset should be automatically detected by clients (and limited to UTF-8 and UTF-16), but this is not the case in practice.
I fixed this the other day in master https://github.com/spring-cloud/spring-cloud-netflix/commit/d76bd84466616f53e5eee6879fee9a823d767841, but it needs to be ported to Camden
Now back-ported to Camden https://github.com/spring-cloud/spring-cloud-netflix/commit/234c4c65ae6566e300b36e35ef637e14a9a7c562
I am working on a Spring Boot app that uses "spring-cloud-starter-zuul". After upgrading to version 1.4.4 I am getting following exception for HTTP POST requests. HTTP GET request seems to be working fine.
2017-01-27 14:28:21.329 WARN 6792 --- [ XNIO-2 task-11] o.s.c.n.z.filters.post.SendErrorFilter : Error during filtering
HTTP headers:-
Looks like the ';' character in Content-Type header value is causing the issue. Reverting to 1.4.3.RELEASE does not cause this problem.