Aias00 opened a new issue, #6756:
URL: https://github.com/apache/shenyu/issues/6756

   - severity: Medium
   - files: 
`shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-response-transformer/src/main/java/org/apache/shenyu/plugin/ai/transformer/response/AiResponseTransformerPlugin.java:359-371`
   - description: In the decorator's inner `flatMap`, the code does 
`this.getHeaders().clear(); this.getHeaders().putAll(newHeaders);` BEFORE 
checking whether `newBody` is non-null. If body extraction fails (returns 
null), the else-branch returns the ORIGINAL body bytes but with response 
headers already replaced by whatever the AI emitted. Original 
`Content-Type`/`Content-Length` are gone.
   - impact: Corrupted response headers (and Content-Length mismatch) on any AI 
transformation where body extraction fails.
   - suggested_fix: Only mutate headers after both header AND body extraction 
succeed.
   - confidence: High
   - related_existing: none — SEC-9 covers gzip decompression in the same file, 
not this ordering bug.
   
   ---
   _Identified during the 2026-08-02 deep re-scan; full list in 
[`docs/scan2-2026-08-02/06-medium-tiers.md`](docs/scan2-2026-08-02/06-medium-tiers.md)._


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