Support application/json content type sent by non-SCSt applications

Fixes #399
This commit is contained in:
Marius Bogoevici
2016-03-04 12:06:37 -05:00
parent 7021d2195d
commit cb73f26466

View File

@@ -16,6 +16,7 @@
package org.springframework.cloud.stream.binder;
import static org.springframework.util.MimeTypeUtils.APPLICATION_JSON;
import static org.springframework.util.MimeTypeUtils.APPLICATION_OCTET_STREAM;
import static org.springframework.util.MimeTypeUtils.TEXT_PLAIN;
@@ -425,7 +426,7 @@ public abstract class AbstractBinder<T> implements ApplicationContextAware, Init
}
private Object deserializePayload(byte[] bytes, MimeType contentType) {
if (TEXT_PLAIN.equals(contentType)) {
if (TEXT_PLAIN.equals(contentType) || APPLICATION_JSON.equals(contentType)) {
try {
return new String(bytes, "UTF-8");
}