Fix multiple Content-Language values in MockHttpServletResponse
Prior to this commit, `MockHttpServletResponse` would only support adding a `Content-Language` once. Adding multiple header values would always replace the content-language property in the response and the entire header value. This commit ensures that this behavior is supported. Fixes gh-34488
This commit is contained in:
@@ -641,4 +641,12 @@ class MockHttpServletResponseTests {
|
||||
assertThat(response.getContentAsString()).isEqualTo(content);
|
||||
}
|
||||
|
||||
@Test // gh-34488
|
||||
void shouldAddMultipleContentLanguage() {
|
||||
response.addHeader("Content-Language", "en");
|
||||
response.addHeader("Content-Language", "fr");
|
||||
assertThat(response.getHeaders("Content-Language")).contains("en", "fr");
|
||||
assertThat(response.getLocale()).isEqualTo(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user