This commit reverts the first optimizations listed in
fa096dc60f, as the default delimiters
do vary, namely by the charset given in the message mime type.
The mimetype charset might not be compatible with ASCII (i.e. anything
but UTF-8 or ISO-8859-1, for instance it might be UTF-16), and will not
successfully find the default delimiters as a consequence.
Added test to indicate the bug.
@ -63,20 +66,18 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
@@ -63,20 +66,18 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
/** The default delimiter strings to use, i.e. {@code \r\n} and {@code \n}. */
Assert.notEmpty(delimiters,"'delimiters' must not be empty");
this.delimiters=newArrayList<>(delimiters);
this.stripDelimiter=stripDelimiter;
}
@ -90,9 +91,7 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
@@ -90,9 +91,7 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
@ -103,6 +102,13 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
@@ -103,6 +102,13 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
@ -234,17 +240,16 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
@@ -234,17 +240,16 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
@ -263,17 +268,16 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
@@ -263,17 +268,16 @@ public final class StringDecoder extends AbstractDataBufferDecoder<String> {
@ -69,22 +72,43 @@ public class StringDecoderTests extends AbstractDataBufferAllocatingTestCase {
@@ -69,22 +72,43 @@ public class StringDecoderTests extends AbstractDataBufferAllocatingTestCase {