diff options
-rw-r--r-- | src/main/java/org/openslx/imagemaster/thrift/server/HttpListener.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/openslx/imagemaster/thrift/server/HttpListener.java b/src/main/java/org/openslx/imagemaster/thrift/server/HttpListener.java index f130989..b56f64e 100644 --- a/src/main/java/org/openslx/imagemaster/thrift/server/HttpListener.java +++ b/src/main/java/org/openslx/imagemaster/thrift/server/HttpListener.java @@ -1,6 +1,7 @@ package org.openslx.imagemaster.thrift.server; import java.io.IOException; +import java.util.Arrays; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -62,8 +63,7 @@ public class HttpListener extends NanoHTTPD processor.process( inprotocol, outprotocol ); - buffer = new byte[ outbuffer.length() ]; - outbuffer.readAll( buffer, 0, buffer.length ); + buffer = Arrays.copyOf( outbuffer.getArray(), outbuffer.length() ); Response response = new Response( Response.Status.OK, "application/json", buffer ); addCorsHeaders( response ); |