Polishing

This commit is contained in:
Juergen Hoeller
2019-01-08 18:45:16 +01:00
parent 183f367f2c
commit e0283c2edf
9 changed files with 56 additions and 67 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2018 the original author or authors.
* Copyright 2002-2019 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -340,15 +340,15 @@ public class FormHttpMessageConverter implements HttpMessageConverter<MultiValue
}
}
private void writeMultipart(final MultiValueMap<String, Object> parts,
HttpOutputMessage outputMessage) throws IOException {
private void writeMultipart(final MultiValueMap<String, Object> parts, HttpOutputMessage outputMessage)
throws IOException {
final byte[] boundary = generateMultipartBoundary();
Map<String, String> parameters = new LinkedHashMap<>(2);
if (!isFilenameCharsetSet()) {
parameters.put("charset", this.charset.name());
}
parameters.put("boundary", new String(boundary, "US-ASCII"));
parameters.put("boundary", new String(boundary, StandardCharsets.US_ASCII));
MediaType contentType = new MediaType(MediaType.MULTIPART_FORM_DATA, parameters);
HttpHeaders headers = outputMessage.getHeaders();