Skip to content

Conversation

@AlinsRan
Copy link
Contributor

@AlinsRan AlinsRan commented Sep 5, 2025

Type of change:

  • Bugfix
  • New feature provided
  • Improve performance
  • Backport patches
  • Documentation
  • Refactor
  • Chore
  • CI/CD or Tests

What this PR does / why we need it:

image

In the type definition, they are mandatory. If only add is set, the other two will be empty arrays and empty objects, respectively:

type ResponseHeaders struct {
Set map[string]string `json:"set" yaml:"set"`
Add []string `json:"add" yaml:"add"`
Remove []string `json:"remove" yaml:"remove"`
}

When only one of add, set, or remove is defined, schema validation (e.g., minItems=1) cannot be guaranteed by the data plane.

https://github.com/apache/apisix/blob/9e34661e7edb57fa76a215333b92c6d086e80076/apisix/plugins/response-rewrite.lua#L59-L80

Pre-submission checklist:

  • Did you explain what problem does this PR solve? Or what new features have been added?
  • Have you added corresponding test cases?
  • Have you modified the corresponding document?
  • Is this PR backward compatible? If it is not backward compatible, please discuss on the mailing list first

@AlinsRan AlinsRan marked this pull request as ready for review September 5, 2025 01:03
@AlinsRan AlinsRan merged commit f172410 into apache:master Sep 5, 2025
22 checks passed
@AlinsRan AlinsRan deleted the fix/httproutefilter-response-header-modifier branch September 5, 2025 02:44
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.

3 participants