File tree 3 files changed +12
-3
lines changed
libs/x-content/impl/src/main/java/org/elasticsearch/xcontent/provider
3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change 11
11
import com .fasterxml .jackson .core .JsonEncoding ;
12
12
import com .fasterxml .jackson .core .JsonGenerator ;
13
13
import com .fasterxml .jackson .core .JsonParser ;
14
+ import com .fasterxml .jackson .core .StreamReadConstraints ;
14
15
import com .fasterxml .jackson .dataformat .cbor .CBORConstants ;
15
16
import com .fasterxml .jackson .dataformat .cbor .CBORFactory ;
16
17
@@ -45,7 +46,9 @@ public static XContent cborXContent() {
45
46
}
46
47
47
48
static {
48
- cborFactory = new CBORFactory ();
49
+ var builder = CBORFactory .builder ();
50
+ builder .streamReadConstraints (StreamReadConstraints .builder ().maxStringLength (Integer .MAX_VALUE ).build ());
51
+ cborFactory = builder .build ();
49
52
cborFactory .configure (CBORFactory .Feature .FAIL_ON_SYMBOL_HASH_OVERFLOW , false ); // this trips on many mappings now...
50
53
// Do not automatically close unclosed objects/arrays in com.fasterxml.jackson.dataformat.cbor.CBORGenerator#close() method
51
54
cborFactory .configure (JsonGenerator .Feature .AUTO_CLOSE_JSON_CONTENT , false );
Original file line number Diff line number Diff line change 11
11
import com .fasterxml .jackson .core .JsonEncoding ;
12
12
import com .fasterxml .jackson .core .JsonGenerator ;
13
13
import com .fasterxml .jackson .core .JsonParser ;
14
+ import com .fasterxml .jackson .core .StreamReadConstraints ;
14
15
import com .fasterxml .jackson .dataformat .smile .SmileConstants ;
15
16
import com .fasterxml .jackson .dataformat .smile .SmileFactory ;
16
17
import com .fasterxml .jackson .dataformat .smile .SmileGenerator ;
@@ -45,7 +46,9 @@ public static XContent smileXContent() {
45
46
}
46
47
47
48
static {
48
- smileFactory = new SmileFactory ();
49
+ var builder = SmileFactory .builder ();
50
+ builder .streamReadConstraints (StreamReadConstraints .builder ().maxStringLength (Integer .MAX_VALUE ).build ());
51
+ smileFactory = builder .build ();
49
52
// for now, this is an overhead, might make sense for web sockets
50
53
smileFactory .configure (SmileGenerator .Feature .ENCODE_BINARY_AS_7BIT , false );
51
54
smileFactory .configure (SmileFactory .Feature .FAIL_ON_SYMBOL_HASH_OVERFLOW , false ); // this trips on many mappings now...
Original file line number Diff line number Diff line change 10
10
11
11
import com .fasterxml .jackson .core .JsonEncoding ;
12
12
import com .fasterxml .jackson .core .JsonParser ;
13
+ import com .fasterxml .jackson .core .StreamReadConstraints ;
13
14
import com .fasterxml .jackson .dataformat .yaml .YAMLFactory ;
14
15
15
16
import org .elasticsearch .xcontent .XContent ;
@@ -42,7 +43,9 @@ public static XContent yamlXContent() {
42
43
}
43
44
44
45
static {
45
- yamlFactory = new YAMLFactory ();
46
+ var builder = YAMLFactory .builder ();
47
+ builder .streamReadConstraints (StreamReadConstraints .builder ().maxStringLength (Integer .MAX_VALUE ).build ());
48
+ yamlFactory = builder .build ();
46
49
yamlFactory .configure (JsonParser .Feature .STRICT_DUPLICATE_DETECTION , true );
47
50
yamlFactory .configure (JsonParser .Feature .USE_FAST_DOUBLE_PARSER , true );
48
51
yamlXContent = new YamlXContentImpl ();
You can’t perform that action at this time.
0 commit comments