From 650eb196224603117b8799a0a5bc23fa18e78b4e Mon Sep 17 00:00:00 2001 From: kimchy Date: Fri, 30 Apr 2010 02:47:27 +0300 Subject: [PATCH] better auto identification of xson content --- .../java/org/elasticsearch/util/xcontent/XContentFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/util/xcontent/XContentFactory.java b/modules/elasticsearch/src/main/java/org/elasticsearch/util/xcontent/XContentFactory.java index a2fdbaca8b8..1eff8f5565e 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/util/xcontent/XContentFactory.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/util/xcontent/XContentFactory.java @@ -23,7 +23,6 @@ import org.elasticsearch.ElasticSearchIllegalArgumentException; import org.elasticsearch.util.xcontent.builder.BinaryXContentBuilder; import org.elasticsearch.util.xcontent.builder.TextXContentBuilder; import org.elasticsearch.util.xcontent.json.JsonXContent; -import org.elasticsearch.util.xcontent.xson.XsonType; import org.elasticsearch.util.xcontent.xson.XsonXContent; import java.io.IOException; @@ -147,7 +146,7 @@ public class XContentFactory { */ public static XContentType xContentType(byte[] data, int offset, int length) { length = length < GUESS_HEADER_LENGTH ? length : GUESS_HEADER_LENGTH; - if (length > 1 && data[0] == XsonType.HEADER) { + if (length > 1 && data[0] == 0x00 && data[1] == 0x00) { return XContentType.XSON; } for (int i = offset; i < length; i++) {