Skip to content

Commit 8df704e

Browse files
committed
allow for json and xson to be parsed in content type
1 parent 7c53ef1 commit 8df704e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/elasticsearch/src/main/java/org/elasticsearch/util/xcontent/XContentType.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,11 @@ public static XContentType fromRestContentType(String contentType) {
3939
if (contentType == null) {
4040
return null;
4141
}
42-
if ("application/json".equals(contentType)) {
42+
if ("application/json".equals(contentType) || "json".equalsIgnoreCase(contentType)) {
4343
return JSON;
4444
}
4545

46-
if ("application/xson".equals(contentType)) {
46+
if ("application/xson".equals(contentType) || "xson".equalsIgnoreCase(contentType)) {
4747
return XSON;
4848
}
4949

0 commit comments

Comments
 (0)