Try defaulContentType for application/octet-stream
AbstractHttpMessageConverter now tries to call getDefaultContentType with the actual value to be converted to see if that will result in a more concrete mediat type than application/octet-stream. Issue: SPR-12894
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2014 the original author or authors.
|
||||
* Copyright 2002-2015 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.
|
||||
@@ -174,6 +174,10 @@ public abstract class AbstractHttpMessageConverter<T> implements HttpMessageConv
|
||||
if (contentType == null || contentType.isWildcardType() || contentType.isWildcardSubtype()) {
|
||||
contentTypeToUse = getDefaultContentType(t);
|
||||
}
|
||||
else if (MediaType.APPLICATION_OCTET_STREAM.equals(contentType)) {
|
||||
MediaType type = getDefaultContentType(t);
|
||||
contentTypeToUse = (type != null ? type : contentTypeToUse);
|
||||
}
|
||||
if (contentTypeToUse != null) {
|
||||
headers.setContentType(contentTypeToUse);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user