Fix bug for body reading in HttpServerHandler of sentinel-transport-netty-http (#185)
- Do a manual copying from unpooled direct buffer.
This commit is contained in:
parent
7626bf4a49
commit
d861a364c9
|
|
@ -178,7 +178,9 @@ public class HttpServerHandler extends SimpleChannelInboundHandler<Object> {
|
||||||
if (request.content().readableBytes() <= 0) {
|
if (request.content().readableBytes() <= 0) {
|
||||||
serverRequest.setBody(null);
|
serverRequest.setBody(null);
|
||||||
} else {
|
} else {
|
||||||
serverRequest.setBody(request.content().array());
|
byte[] body = new byte[request.content().readableBytes()];
|
||||||
|
request.content().getBytes(0, body);
|
||||||
|
serverRequest.setBody(body);
|
||||||
}
|
}
|
||||||
return serverRequest;
|
return serverRequest;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue