Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 9 additions & 7 deletions internal/adc/translator/httproute.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 != "" {
Expand Down
Loading