MockHttpServletResponse - handle multiple values for Content-Language header #34488
Labels
in: test
Issues in the test module
status: backported
An issue that has been backported to maintenance branches
type: bug
A general bug
Milestone
Affects: 6.x+
It seems that if we provide multiple values for
CONTENT_LANGUAGE
as an array like:It won't work nicely with
MockHttpServletResponse
.The logic we have there in
setSpecialHeader
method:spring-framework/spring-test/src/main/java/org/springframework/mock/web/MockHttpServletResponse.java
Lines 756 to 767 in 8b14bf8
expects that all the values are sent in a
value
.but from debugging, I saw that
ServletServerHttpResponse
will callsetSpecialHeader
ofMockHttpServletResponse
for each header's value.spring-framework/spring-web/src/main/java/org/springframework/http/server/ServletServerHttpResponse.java
Lines 113 to 119 in 8b14bf8
Thus, only the last value will be present in the response.
The text was updated successfully, but these errors were encountered: