Skip to content

Commit 3a91690

Browse files
committed
Backport fix for malformed HTTP decoder loop
1 parent faf9e5c commit 3a91690

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mina-http/src/main/java/org/apache/mina/http/HttpServerDecoder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ public void dispose(IoSession session) throws Exception {
194194
}
195195

196196
private HttpRequestImpl parseHttpRequestHead(ByteBuffer buffer) {
197-
String raw = new String(buffer.array(), 0, buffer.limit());
197+
String raw = new String(buffer.array(), buffer.position(), buffer.remaining());
198198
String[] headersAndBody = RAW_VALUE_PATTERN.split(raw, -1);
199199

200200
if (headersAndBody.length <= 1) {

0 commit comments

Comments
 (0)