|
|
|
@ -3,12 +3,15 @@ package org.springframework.cloud.gateway.config;
@@ -3,12 +3,15 @@ package org.springframework.cloud.gateway.config;
|
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
import javax.validation.constraints.NotNull; |
|
|
|
|
|
|
|
|
|
import org.springframework.boot.context.properties.ConfigurationProperties; |
|
|
|
|
import org.springframework.cloud.gateway.api.FilterDefinition; |
|
|
|
|
import org.springframework.cloud.gateway.api.Route; |
|
|
|
|
import org.springframework.cloud.gateway.filter.route.RemoveNonProxyHeadersRouteFilter; |
|
|
|
|
|
|
|
|
|
import javax.validation.Valid; |
|
|
|
|
import javax.validation.constraints.NotNull; |
|
|
|
|
import static org.springframework.cloud.gateway.support.NameUtils.normalizeFilterName; |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* @author Spencer Gibb |
|
|
|
@ -26,7 +29,15 @@ public class GatewayProperties {
@@ -26,7 +29,15 @@ public class GatewayProperties {
|
|
|
|
|
/** |
|
|
|
|
* 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() { |
|
|
|
|
return routes; |
|
|
|
|