Skip to content

fix(ai): preserve headers on transform fallback - #7122

Open
dengliming wants to merge 1 commit into
apache:masterfrom
dengliming:fix-6756-transformer-header-validation
Open

dengliming wants to merge 1 commit into
apache:masterfrom
dengliming:fix-6756-transformer-header-validation

Conversation

@dengliming

Copy link
Copy Markdown
Member

Summary

  • keep original response headers when the transformed response has no valid body
  • apply AI-provided headers only when the transformed body is accepted
  • add regression coverage for the fallback path

Testing

  • mvn -q -pl shenyu-plugin/shenyu-plugin-ai/shenyu-plugin-ai-response-transformer -am -DskipTests=false -Dcheckstyle.skip=false -Dtest=AiResponseTransformerPluginTest -DfailIfNoTests=false test

Fixes #6756

@Aias00 Aias00 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved as PMC (Aias00). Reviewed the diff — small, well-scoped fix with regression tests; mergeable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Response transformer mutates response headers before validating body extraction

2 participants