Parcourir la source

Temp. disable use of new PagedBytesReference since it breaks HTTP replies with 0-sized Content-Length

Holger Hoffstätte il y a 11 ans
Parent
commit
424bffca74

+ 3 - 1
src/main/java/org/elasticsearch/common/io/stream/BytesStreamOutput.java

@@ -153,7 +153,9 @@ public class BytesStreamOutput extends StreamOutput implements BytesStream {
 
     @Override
     public BytesReference bytes() {
-        return new PagedBytesReference(bigarrays, bytes, count);
+        BytesRef bref = new BytesRef();
+        bytes.get(0, count, bref);
+        return new BytesArray(bref, false);
     }
 
     private void ensureCapacity(int offset) {