diff --git a/mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java b/mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java index 30c1f8157..87938e2eb 100644 --- a/mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java +++ b/mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java @@ -194,7 +194,7 @@ public void dispose(IoSession session) throws Exception { } private HttpRequestImpl parseHttpRequestHead(ByteBuffer buffer) { - String raw = new String(buffer.array(), 0, buffer.limit()); + String raw = new String(buffer.array(), buffer.position(), buffer.remaining()); String[] headersAndBody = RAW_VALUE_PATTERN.split(raw, -1); if (headersAndBody.length <= 1) {