Affects: 5.x+


The current code in https://github.com/spring-projects/spring-framework/blob/3aa2605fdaa56d5c007f476f3f9bd1c550ec368c/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java#L641-L644

prevent to set multiple languages in the response Content-Language header. A value of "en, it" is translated to the "en" Locale and the subsequent call to setLocale

https://github.com/spring-projects/spring-framework/blob/3aa2605fdaa56d5c007f476f3f9bd1c550ec368c/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java#L344-L346

force the Content-Language to be only "en".

The use of comma separated values for languages is perfectly fine according to the specification, see second example here https://www.w3.org/International/questions/qa-http-and-lang#http_summary

Comment From: sbrannen

Tentatively slated for 5.3 M2, pending design work.

@rstoyanchev, let me know if you foresee any issues with that.

Comment From: sbrannen

This enhancement will be available in upcoming Spring Framework 5.3 M2 snapshots.

Feel free to try it out and report back with any issues you encounter.