Pārlūkot izejas kodu

Fix bug for body reading in HttpServerHandler of sentinel-transport-netty-http (#185)

- Do a manual copying from unpooled direct buffer.
master
jasonjoo2010 Eric Zhao pirms 6 gadiem
vecāks
revīzija
d861a364c9
1 mainītis faili ar 3 papildinājumiem un 1 dzēšanām
  1. +3
    -1
      sentinel-transport/sentinel-transport-netty-http/src/main/java/com/alibaba/csp/sentinel/transport/command/netty/HttpServerHandler.java

+ 3
- 1
sentinel-transport/sentinel-transport-netty-http/src/main/java/com/alibaba/csp/sentinel/transport/command/netty/HttpServerHandler.java Parādīt failu

@@ -178,7 +178,9 @@ public class HttpServerHandler extends SimpleChannelInboundHandler<Object> {
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;
}


Notiek ielāde…
Atcelt
Saglabāt