a807966224 commented on issue #3765:
URL: https://github.com/apache/shenyu/issues/3765#issuecomment-1197627534

   > This should be their own business code. I think just pay attention to :
   > 
   > ```java
   >             return DataBufferUtils.join(exchange.getRequest().getBody())
   >                     .flatMap(dataBuffer -> {
   >                         byte[] bytes = new 
byte[dataBuffer.readableByteCount()];
   >                         dataBuffer.read(bytes);
   >                         DataBufferUtils.release(dataBuffer);
   >                         String body = Strings.fromUTF8ByteArray(bytes);
   >                         
exchange.getAttributes().put(ConstantUtil.CACHE_REQUEST_BODY_OBJECT_KEY, body);
   >                         ServerHttpRequest mutatedRequest = new 
ServerHttpRequestDecorator(
   >                                 exchange.getRequest()) {
   >                             @Override
   >                             public Flux<DataBuffer> getBody() {
   >                                 DataBuffer buffer = 
exchange.getResponse().bufferFactory().wrap(bytes);
   >                                 return Flux.just(buffer);
   >                             }
   >                         };
   >                         return 
chain.filter(exchange.mutate().request(mutatedRequest).build());
   >                     });
   > ```
   
   yes,
   Now I have tested and found that if I implement the method of reading body 
repeatedly, there will be leakage information after the pressure test, so I 
need to help you check whether there is any problem with my way of using it


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to