Skip to content

Commit

Permalink
Stop adding all header filters to virtual host when generating xDS fo…
Browse files Browse the repository at this point in the history
…r api-gateway
  • Loading branch information
nathancoleman committed Jun 10, 2023
1 parent 8c5e168 commit 4602602
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions agent/xds/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -477,8 +477,6 @@ func (s *ResourceGenerator) routesForAPIGateway(cfgSnap *proxycfg.ConfigSnapshot
return nil, err
}

addHeaderFiltersToVirtualHost(&reformatedRoute, virtualHost)

defaultRoute.VirtualHosts = append(defaultRoute.VirtualHosts, virtualHost)
}

Expand Down Expand Up @@ -1097,16 +1095,6 @@ func injectHeaderManipToRoute(dest *structs.ServiceRouteDestination, r *envoy_ro
return nil
}

func addHeaderFiltersToVirtualHost(dest *structs.HTTPRouteConfigEntry, vh *envoy_route_v3.VirtualHost) {
for _, rule := range dest.Rules {
for _, header := range rule.Filters.Headers {
vh.RequestHeadersToAdd = append(vh.RequestHeadersToAdd, makeHeadersValueOptions(header.Add, true)...)
vh.RequestHeadersToAdd = append(vh.RequestHeadersToAdd, makeHeadersValueOptions(header.Set, false)...)
vh.RequestHeadersToRemove = append(vh.RequestHeadersToRemove, header.Remove...)
}
}
}

func injectHeaderManipToVirtualHost(dest *structs.IngressService, vh *envoy_route_v3.VirtualHost) error {
if !dest.RequestHeaders.IsZero() {
vh.RequestHeadersToAdd = append(
Expand Down

0 comments on commit 4602602

Please sign in to comment.