dragon-zhang commented on issue #3765:
URL: https://github.com/apache/shenyu/issues/3765#issuecomment-1197598316

   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());
                       });
   ```


-- 
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