polishing
This commit is contained in:
parent
23e58aa718
commit
450a3d7eee
|
|
@ -306,7 +306,7 @@ public class MockHttpServletRequest implements HttpServletRequest {
|
|||
private void updateContentTypeHeader() {
|
||||
if (this.contentType != null) {
|
||||
StringBuilder sb = new StringBuilder(this.contentType);
|
||||
if (this.contentType.toLowerCase().indexOf(CHARSET_PREFIX) == -1 && this.characterEncoding != null) {
|
||||
if (!this.contentType.toLowerCase().contains(CHARSET_PREFIX) && this.characterEncoding != null) {
|
||||
sb.append(";").append(CHARSET_PREFIX).append(this.characterEncoding);
|
||||
}
|
||||
doAddHeaderValue(CONTENT_TYPE_HEADER, sb.toString(), true);
|
||||
|
|
|
|||
|
|
@ -990,7 +990,7 @@ public class AnnotationMethodHandlerAdapter extends WebContentGenerator
|
|||
HttpInputMessage inputMessage = createHttpInputMessage(webRequest);
|
||||
HttpOutputMessage outputMessage = createHttpOutputMessage(webRequest);
|
||||
if (responseEntity instanceof ResponseEntity && outputMessage instanceof ServerHttpResponse) {
|
||||
((ServerHttpResponse)outputMessage).setStatusCode(((ResponseEntity) responseEntity).getStatusCode());
|
||||
((ServerHttpResponse) outputMessage).setStatusCode(((ResponseEntity) responseEntity).getStatusCode());
|
||||
}
|
||||
HttpHeaders entityHeaders = responseEntity.getHeaders();
|
||||
if (!entityHeaders.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ public interface MultipartRequest {
|
|||
* Determine the content type of the specified request part.
|
||||
* @param paramOrFileName the name of the part
|
||||
* @return the associated content type, or <code>null</code> if not defined
|
||||
* @since 3.1
|
||||
*/
|
||||
String getMultipartContentType(String paramOrFileName);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue