Only write non-default charset in MultipartWriterSupport
This commit only writes the 'charset' parameter in the written headers if it is non-default (not UTF-8), since RFC7578 states that the only allowed parameter is 'boundary'. Closes gh-25885
This commit is contained in:
@@ -190,7 +190,7 @@ public class MultipartHttpMessageWriterTests extends AbstractLeakCheckingTests {
|
||||
assertThat(contentType.isCompatibleWith(mediaType)).isTrue();
|
||||
assertThat(contentType.getParameter("type")).isEqualTo("foo");
|
||||
assertThat(contentType.getParameter("boundary")).isNotEmpty();
|
||||
assertThat(contentType.getParameter("charset")).isEqualTo("UTF-8");
|
||||
assertThat(contentType.getParameter("charset")).isNull();
|
||||
|
||||
MultiValueMap<String, Part> requestParts = parse(this.response, hints);
|
||||
assertThat(requestParts.size()).isEqualTo(2);
|
||||
|
||||
Reference in New Issue
Block a user