Browse Source

add RemoveNonProxyHeaders filter

pull/41/head
Spencer Gibb 8 years ago
parent
commit
594e80618a
No known key found for this signature in database
GPG Key ID: 7788A47380690861
  1. 17
      src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java

17
src/main/java/org/springframework/cloud/gateway/config/GatewayProperties.java

@ -3,12 +3,15 @@ package org.springframework.cloud.gateway.config;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import org.springframework.boot.context.properties.ConfigurationProperties; import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.cloud.gateway.api.FilterDefinition; import org.springframework.cloud.gateway.api.FilterDefinition;
import org.springframework.cloud.gateway.api.Route; import org.springframework.cloud.gateway.api.Route;
import org.springframework.cloud.gateway.filter.route.RemoveNonProxyHeadersRouteFilter;
import javax.validation.Valid; import static org.springframework.cloud.gateway.support.NameUtils.normalizeFilterName;
import javax.validation.constraints.NotNull;
/** /**
* @author Spencer Gibb * @author Spencer Gibb
@ -26,7 +29,15 @@ public class GatewayProperties {
/** /**
* List of filter definitions that are applied to every route. * List of filter definitions that are applied to every route.
*/ */
private List<FilterDefinition> defaultFilters = new ArrayList<>(); private List<FilterDefinition> defaultFilters = loadDefaults();
private ArrayList<FilterDefinition> loadDefaults() {
ArrayList<FilterDefinition> defaults = new ArrayList<>();
FilterDefinition definition = new FilterDefinition();
definition.setName(normalizeFilterName(RemoveNonProxyHeadersRouteFilter.class));
defaults.add(definition);
return defaults;
}
public List<Route> getRoutes() { public List<Route> getRoutes() {
return routes; return routes;

Loading…
Cancel
Save