Skip to content

Commit

Permalink
Fix bug for body reading in HttpServerHandler of sentinel-transport-n…
Browse files Browse the repository at this point in the history
…etty-http (alibaba#185)

- Do a manual copying from unpooled direct buffer.
  • Loading branch information
jasonjoo2010 authored and sczyh30 committed Oct 16, 2018
1 parent 7626bf4 commit d861a36
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,9 @@ private CommandRequest parseRequest(FullHttpRequest request) {
if (request.content().readableBytes() <= 0) {
serverRequest.setBody(null);
} else {
serverRequest.setBody(request.content().array());
byte[] body = new byte[request.content().readableBytes()];
request.content().getBytes(0, body);
serverRequest.setBody(body);
}
return serverRequest;
}
Expand Down

0 comments on commit d861a36

Please sign in to comment.