This is an automated email from the ASF dual-hosted git repository.
alinsran pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/apisix-ingress-controller.git
The following commit(s) were added to refs/heads/master by this push:
new f6db4561 fix(conformance-test): HTTPRouteRewriteHost (#2596)
f6db4561 is described below
commit f6db45615cf9fdb3928d26cce5307243973c7b83
Author: AlinsRan <[email protected]>
AuthorDate: Sat Oct 11 14:29:53 2025 +0800
fix(conformance-test): HTTPRouteRewriteHost (#2596)
---
Makefile | 2 +-
internal/adc/translator/httproute.go | 16 +++++++++-------
2 files changed, 10 insertions(+), 8 deletions(-)
diff --git a/Makefile b/Makefile
index e82b876a..a5f0606b 100644
--- a/Makefile
+++ b/Makefile
@@ -52,7 +52,7 @@ GO_LDFLAGS ?= "-X=$(VERSYM)=$(VERSION)
-X=$(GITSHASYM)=$(GITSHA) -X=$(BUILDOSSYM
# gateway-api
GATEAY_API_VERSION ?= v1.3.0
##
https://github.com/kubernetes-sigs/gateway-api/blob/v1.3.0/pkg/features/httproute.go
-SUPPORTED_EXTENDED_FEATURES =
"HTTPRouteDestinationPortMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteRequestMirror,HTTPRouteSchemeRedirect,GatewayAddressEmpty,HTTPRouteResponseHeaderModification,GatewayPort8080"
+SUPPORTED_EXTENDED_FEATURES =
"HTTPRouteDestinationPortMatching,HTTPRouteMethodMatching,HTTPRoutePortRedirect,HTTPRouteRequestMirror,HTTPRouteSchemeRedirect,GatewayAddressEmpty,HTTPRouteResponseHeaderModification,GatewayPort8080,HTTPRouteHostRewrite"
CONFORMANCE_TEST_REPORT_OUTPUT ?=
$(DIR)/apisix-ingress-controller-conformance-report.yaml
##
https://github.com/kubernetes-sigs/gateway-api/blob/v1.3.0/conformance/utils/suite/profiles.go
CONFORMANCE_PROFILES ?= GATEWAY-HTTP,GATEWAY-GRPC
diff --git a/internal/adc/translator/httproute.go
b/internal/adc/translator/httproute.go
index 7d829b16..c529024d 100644
--- a/internal/adc/translator/httproute.go
+++ b/internal/adc/translator/httproute.go
@@ -179,17 +179,19 @@ func (t *Translator)
fillPluginFromHTTPRequestHeaderFilter(plugins adctypes.Plug
obj := plugins[pluginName]
var plugin *adctypes.RewriteConfig
if obj == nil {
- plugin = &adctypes.RewriteConfig{
- Headers: &adctypes.Headers{
- Add: make(map[string]string,
len(reqHeaderModifier.Add)),
- Set: make(map[string]string,
len(reqHeaderModifier.Set)),
- Remove: make([]string, 0,
len(reqHeaderModifier.Remove)),
- },
- }
+ plugin = &adctypes.RewriteConfig{}
plugins[pluginName] = plugin
} else {
plugin = obj.(*adctypes.RewriteConfig)
}
+ if plugin.Headers == nil {
+ plugin.Headers = &adctypes.Headers{
+ Add: make(map[string]string,
len(reqHeaderModifier.Add)),
+ Set: make(map[string]string,
len(reqHeaderModifier.Set)),
+ Remove: make([]string, 0,
len(reqHeaderModifier.Remove)),
+ }
+ }
+
for _, header := range reqHeaderModifier.Add {
val := plugin.Headers.Add[string(header.Name)]
if val != "" {