update ruoyi-gateway/src/main/java/org/dromara/gateway/utils/WebFluxUtils.java.

遍历ByteBuffer,不然可能会遇到body不完整,现象是日志中打印的参数不全,被截断。

Signed-off-by: java9 <qzzsunly@163.com>
This commit is contained in:
java9
2025-03-19 09:33:50 +00:00
committed by Gitee
parent 2b623c005a
commit c611dff7f2

View File

@@ -88,8 +88,11 @@ public class WebFluxUtils {
}
DataBuffer buffer = (DataBuffer) obj;
try (DataBuffer.ByteBufferIterator iterator = buffer.readableByteBuffers()) {
CharBuffer charBuffer = StandardCharsets.UTF_8.decode(iterator.next());
return charBuffer.toString();
StringBuilder sb = new StringBuilder();
iterator.forEachRemaining(e -> {
sb.append(StandardCharsets.UTF_8.decode(e));
});
return sb.toString();
}
}