Compare commits

...

5 Commits
main ... 2.0.x

  1. 2
      docs/pom.xml
  2. 1
      docs/src/main/asciidoc/index.adoc
  3. 2
      pom.xml
  4. 2
      spring-cloud-gateway-core/pom.xml
  5. 46
      spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/RouteDefinitionRouteLocator.java
  6. 2
      spring-cloud-gateway-dependencies/pom.xml
  7. 2
      spring-cloud-gateway-mvc/pom.xml
  8. 2
      spring-cloud-gateway-sample/pom.xml
  9. 2
      spring-cloud-gateway-webflux/pom.xml
  10. 2
      spring-cloud-starter-gateway/pom.xml

2
docs/pom.xml

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway</artifactId>
<version>2.0.4.BUILD-SNAPSHOT</version>
<version>2.0.5.BUILD-SNAPSHOT</version>
</parent>
<artifactId>spring-cloud-gateway-docs</artifactId>
<packaging>pom</packaging>

1
docs/src/main/asciidoc/index.adoc

@ -0,0 +1 @@ @@ -0,0 +1 @@
spring-cloud-gateway.adoc

2
pom.xml

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway</artifactId>
<version>2.0.4.BUILD-SNAPSHOT</version>
<version>2.0.5.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>Spring Cloud Gateway</name>

2
spring-cloud-gateway-core/pom.xml

@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway</artifactId>
<version>2.0.4.BUILD-SNAPSHOT</version>
<version>2.0.5.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath> <!-- lookup parent from repository -->
</parent>
<artifactId>spring-cloud-gateway-core</artifactId>

46
spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/route/RouteDefinitionRouteLocator.java

@ -134,36 +134,30 @@ public class RouteDefinitionRouteLocator implements RouteLocator, BeanFactoryAwa @@ -134,36 +134,30 @@ public class RouteDefinitionRouteLocator implements RouteLocator, BeanFactoryAwa
}
@SuppressWarnings("unchecked")
private List<GatewayFilter> loadGatewayFilters(String id, List<FilterDefinition> filterDefinitions) {
List<GatewayFilter> filters = filterDefinitions.stream()
.map(definition -> {
GatewayFilterFactory factory = this.gatewayFilterFactories.get(definition.getName());
if (factory == null) {
throw new IllegalArgumentException("Unable to find GatewayFilterFactory with name " + definition.getName());
}
Map<String, String> args = definition.getArgs();
if (logger.isDebugEnabled()) {
logger.debug("RouteDefinition " + id + " applying filter " + args + " to " + definition.getName());
}
Map<String, Object> properties = factory.shortcutType().normalize(args, factory, this.parser, this.beanFactory);
List<GatewayFilter> loadGatewayFilters(String id, List<FilterDefinition> filterDefinitions) {
ArrayList<GatewayFilter> ordered = new ArrayList<>(filterDefinitions.size());
for (int i = 0; i < filterDefinitions.size(); i++) {
FilterDefinition definition = filterDefinitions.get(i);
GatewayFilterFactory factory = this.gatewayFilterFactories.get(definition.getName());
if (factory == null) {
throw new IllegalArgumentException("Unable to find GatewayFilterFactory with name " + definition.getName());
}
Map<String, String> args = definition.getArgs();
if (logger.isDebugEnabled()) {
logger.debug("RouteDefinition " + id + " applying filter " + args + " to " + definition.getName());
}
Object configuration = factory.newConfig();
Map<String, Object> properties = factory.shortcutType().normalize(args, factory, this.parser, this.beanFactory);
ConfigurationUtils.bind(configuration, properties,
factory.shortcutFieldPrefix(), definition.getName(), validator);
Object configuration = factory.newConfig();
GatewayFilter gatewayFilter = factory.apply(configuration);
if (this.publisher != null) {
this.publisher.publishEvent(new FilterArgsEvent(this, id, properties));
}
return gatewayFilter;
})
.collect(Collectors.toList());
ConfigurationUtils.bind(configuration, properties,
factory.shortcutFieldPrefix(), definition.getName(), validator);
ArrayList<GatewayFilter> ordered = new ArrayList<>(filters.size());
for (int i = 0; i < filters.size(); i++) {
GatewayFilter gatewayFilter = filters.get(i);
GatewayFilter gatewayFilter = factory.apply(configuration);
if (this.publisher != null) {
this.publisher.publishEvent(new FilterArgsEvent(this, id, properties));
}
if (gatewayFilter instanceof Ordered) {
ordered.add(gatewayFilter);
}

2
spring-cloud-gateway-dependencies/pom.xml

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
</parent>
<artifactId>spring-cloud-gateway-dependencies</artifactId>
<version>2.0.4.BUILD-SNAPSHOT</version>
<version>2.0.5.BUILD-SNAPSHOT</version>
<packaging>pom</packaging>
<name>spring-cloud-gateway-dependencies</name>

2
spring-cloud-gateway-mvc/pom.xml

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway</artifactId>
<version>2.0.4.BUILD-SNAPSHOT</version>
<version>2.0.5.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

2
spring-cloud-gateway-sample/pom.xml

@ -16,7 +16,7 @@ @@ -16,7 +16,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway</artifactId>
<version>2.0.4.BUILD-SNAPSHOT</version>
<version>2.0.5.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath> <!-- lookup parent from repository -->
</parent>

2
spring-cloud-gateway-webflux/pom.xml

@ -10,7 +10,7 @@ @@ -10,7 +10,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway</artifactId>
<version>2.0.4.BUILD-SNAPSHOT</version>
<version>2.0.5.BUILD-SNAPSHOT</version>
<relativePath/>
</parent>

2
spring-cloud-starter-gateway/pom.xml

@ -5,7 +5,7 @@ @@ -5,7 +5,7 @@
<parent>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-gateway</artifactId>
<version>2.0.4.BUILD-SNAPSHOT</version>
<version>2.0.5.BUILD-SNAPSHOT</version>
<relativePath>..</relativePath> <!-- lookup parent from repository -->
</parent>
<artifactId>spring-cloud-starter-gateway</artifactId>

Loading…
Cancel
Save