Accept all media types in StringDecodere

This commit adds the "*/*" media type in the list of compatible media
types for the StringDecoder. This allows this decoder to decoder
payloads of any media type as long as the target type is String.

Fixes #87
This commit is contained in:
Brian Clozel
2016-04-08 22:18:46 +02:00
parent da2276a954
commit a3b371bf4b
3 changed files with 26 additions and 2 deletions

View File

@@ -25,6 +25,7 @@ import reactor.core.publisher.Flux;
import org.springframework.core.ResolvableType;
import org.springframework.core.io.buffer.DataBuffer;
import org.springframework.util.MimeType;
import org.springframework.util.MimeTypeUtils;
/**
* Decode from a bytes stream to a String stream.
@@ -63,7 +64,7 @@ public class StringDecoder extends AbstractDecoder<String> {
* and decode a single consolidated String or re-emit items as they are provided
*/
public StringDecoder(boolean reduceToSingleBuffer) {
super(new MimeType("text", "*", DEFAULT_CHARSET));
super(new MimeType("text", "*", DEFAULT_CHARSET), MimeTypeUtils.ALL);
this.reduceToSingleBuffer = reduceToSingleBuffer;
}