HY-love-sleep opened a new pull request, #6027: URL: https://github.com/apache/shenyu/pull/6027
问题: 在appendResponse中 逐块处理ByteBuffer, 导致第一个ByteBuffer拥有gzip响应头, 正确解压 , 后续ByteBuffer是压缩流中的中间片段,它们不再包含 header,单独拿出来做 `GZIPInputStream` 解压时,根本无法识别开头,直接就会在构造流或者读数据时报错。后续块一旦解压失败, 会把**原始的压缩字节**原封不动地写入 `BodyWriter`,这样累积到 `BodyWriter` 里的,是乱码的二进制流,而不是解压后的文本。导致token统计不准确。 解决: 通过流式跨块解压, 降低内存消耗同时, 正确处理gizp数据, 统计token 数量 -- 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: notifications-unsubscr...@shenyu.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org