From 89420c331810d3de4e13f6c9fab0d29d4c92d375 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Thu, 20 Jun 2019 17:44:47 +0000 Subject: [PATCH 1/3] Update SNAPSHOT to 2.1.2.RELEASE --- docs/pom.xml | 2 +- pom.xml | 8 ++--- spring-cloud-gateway-core/pom.xml | 2 +- .../support/ServerWebExchangeUtils.java | 32 +++++++++++-------- spring-cloud-gateway-dependencies/pom.xml | 4 +-- spring-cloud-gateway-mvc/pom.xml | 2 +- spring-cloud-gateway-sample/pom.xml | 2 +- spring-cloud-gateway-webflux/pom.xml | 2 +- spring-cloud-starter-gateway/pom.xml | 2 +- 9 files changed, 30 insertions(+), 26 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index b5c65aa6..f8eafd9a 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE spring-cloud-gateway-docs pom diff --git a/pom.xml b/pom.xml index be6e4b30..314fc53a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE pom Spring Cloud Gateway @@ -15,7 +15,7 @@ org.springframework.cloud spring-cloud-build - 2.1.6.BUILD-SNAPSHOT + 2.1.6.RELEASE @@ -52,8 +52,8 @@ UTF-8 UTF-8 1.8 - 2.1.2.BUILD-SNAPSHOT - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE + 2.1.2.RELEASE 0.6 true diff --git a/spring-cloud-gateway-core/pom.xml b/spring-cloud-gateway-core/pom.xml index 6538cbb0..b3e446ac 100644 --- a/spring-cloud-gateway-core/pom.xml +++ b/spring-cloud-gateway-core/pom.xml @@ -7,7 +7,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. spring-cloud-gateway-core diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java index 18fe8dc7..c0aeb6e0 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/support/ServerWebExchangeUtils.java @@ -148,8 +148,9 @@ public final class ServerWebExchangeUtils { public static final String CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR = "cachedServerHttpRequestDecorator"; /** - * Cached request body key. Used when {@link #cacheRequestBodyAndRequest(ServerWebExchange, Function)} - * or {@link #cacheRequestBody(ServerWebExchange, Function)} are called. + * Cached request body key. Used when + * {@link #cacheRequestBodyAndRequest(ServerWebExchange, Function)} or + * {@link #cacheRequestBody(ServerWebExchange, Function)} are called. */ public static final String CACHED_REQUEST_BODY_ATTR = "cachedRequestBody"; @@ -272,9 +273,10 @@ public final class ServerWebExchangeUtils { /** * Caches the request body and the created {@link ServerHttpRequestDecorator} in - * ServerWebExchange attributes. Those attributes are {@link #CACHED_REQUEST_BODY_ATTR} - * and {@link #CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR} respectively. This method - * is useful when the {@link ServerWebExchange} can not be modified, such as a + * ServerWebExchange attributes. Those attributes are + * {@link #CACHED_REQUEST_BODY_ATTR} and + * {@link #CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR} respectively. This method is + * useful when the {@link ServerWebExchange} can not be modified, such as a * {@link RoutePredicateFactory}. * @param exchange the available ServerWebExchange. * @param function a function that accepts the created ServerHttpRequestDecorator. @@ -302,13 +304,13 @@ public final class ServerWebExchangeUtils { /** * Caches the request body in a ServerWebExchange attribute. The attribute is - * {@link #CACHED_REQUEST_BODY_ATTR}. If this method is called from a location - * that can not mutate the ServerWebExchange (such as a Predicate), setting - * cacheDecoratedRequest to true will put a {@link ServerHttpRequestDecorator} in - * an attribute {@link #CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR} for adaptation - * later. + * {@link #CACHED_REQUEST_BODY_ATTR}. If this method is called from a location that + * can not mutate the ServerWebExchange (such as a Predicate), setting + * cacheDecoratedRequest to true will put a {@link ServerHttpRequestDecorator} in an + * attribute {@link #CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR} for adaptation later. * @param exchange the available ServerWebExchange. - * @param cacheDecoratedRequest if true, the ServerHttpRequestDecorator will be cached. + * @param cacheDecoratedRequest if true, the ServerHttpRequestDecorator will be + * cached. * @param function a function that accepts the created ServerHttpRequestDecorator. * @param generic type for the return {@link Mono}. * @return Mono of type T created by the function parameter. @@ -323,7 +325,8 @@ public final class ServerWebExchangeUtils { if (log.isTraceEnabled()) { log.trace("retaining body in exchange attribute"); } - exchange.getAttributes().put(CACHED_REQUEST_BODY_ATTR, dataBuffer); + exchange.getAttributes().put(CACHED_REQUEST_BODY_ATTR, + dataBuffer); } ServerHttpRequestDecorator decorator = new ServerHttpRequestDecorator( @@ -344,10 +347,11 @@ public final class ServerWebExchangeUtils { } }; if (cacheDecoratedRequest) { - exchange.getAttributes().put(CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR, - decorator); + exchange.getAttributes().put( + CACHED_SERVER_HTTP_REQUEST_DECORATOR_ATTR, decorator); } return function.apply(decorator); }); } + } diff --git a/spring-cloud-gateway-dependencies/pom.xml b/spring-cloud-gateway-dependencies/pom.xml index 8b596dc6..1ed98042 100644 --- a/spring-cloud-gateway-dependencies/pom.xml +++ b/spring-cloud-gateway-dependencies/pom.xml @@ -6,12 +6,12 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.1.6.BUILD-SNAPSHOT + 2.1.6.RELEASE spring-cloud-gateway-dependencies - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE pom spring-cloud-gateway-dependencies diff --git a/spring-cloud-gateway-mvc/pom.xml b/spring-cloud-gateway-mvc/pom.xml index a0f2ffd9..e0327f2d 100644 --- a/spring-cloud-gateway-mvc/pom.xml +++ b/spring-cloud-gateway-mvc/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. diff --git a/spring-cloud-gateway-sample/pom.xml b/spring-cloud-gateway-sample/pom.xml index 62f96152..91bd5bc8 100644 --- a/spring-cloud-gateway-sample/pom.xml +++ b/spring-cloud-gateway-sample/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. diff --git a/spring-cloud-gateway-webflux/pom.xml b/spring-cloud-gateway-webflux/pom.xml index ceca2f4c..cfa78666 100644 --- a/spring-cloud-gateway-webflux/pom.xml +++ b/spring-cloud-gateway-webflux/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. diff --git a/spring-cloud-starter-gateway/pom.xml b/spring-cloud-starter-gateway/pom.xml index fd9e63a7..7426c9f9 100644 --- a/spring-cloud-starter-gateway/pom.xml +++ b/spring-cloud-starter-gateway/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.BUILD-SNAPSHOT + 2.1.2.RELEASE .. spring-cloud-starter-gateway From b14de727eb38af44d2af95b22d390f6a57fcd5b8 Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Fri, 21 Jun 2019 12:42:10 -0400 Subject: [PATCH 2/3] Bumping versions to 2.1.3.BUILD-SNAPSHOT after release --- docs/pom.xml | 2 +- pom.xml | 8 ++++---- spring-cloud-gateway-core/pom.xml | 2 +- spring-cloud-gateway-dependencies/pom.xml | 4 ++-- spring-cloud-gateway-mvc/pom.xml | 2 +- spring-cloud-gateway-sample/pom.xml | 2 +- spring-cloud-gateway-webflux/pom.xml | 2 +- spring-cloud-starter-gateway/pom.xml | 2 +- 8 files changed, 12 insertions(+), 12 deletions(-) diff --git a/docs/pom.xml b/docs/pom.xml index f8eafd9a..ed0ff490 100644 --- a/docs/pom.xml +++ b/docs/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.RELEASE + 2.1.3.BUILD-SNAPSHOT spring-cloud-gateway-docs pom diff --git a/pom.xml b/pom.xml index 314fc53a..f3e7fafc 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.RELEASE + 2.1.3.BUILD-SNAPSHOT pom Spring Cloud Gateway @@ -15,7 +15,7 @@ org.springframework.cloud spring-cloud-build - 2.1.6.RELEASE + 2.1.7.BUILD-SNAPSHOT @@ -52,8 +52,8 @@ UTF-8 UTF-8 1.8 - 2.1.2.RELEASE - 2.1.2.RELEASE + 2.1.3.BUILD-SNAPSHOT + 2.1.3.BUILD-SNAPSHOT 0.6 true diff --git a/spring-cloud-gateway-core/pom.xml b/spring-cloud-gateway-core/pom.xml index b3e446ac..f0269ddd 100644 --- a/spring-cloud-gateway-core/pom.xml +++ b/spring-cloud-gateway-core/pom.xml @@ -7,7 +7,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.RELEASE + 2.1.3.BUILD-SNAPSHOT .. spring-cloud-gateway-core diff --git a/spring-cloud-gateway-dependencies/pom.xml b/spring-cloud-gateway-dependencies/pom.xml index 1ed98042..8e8b7ba4 100644 --- a/spring-cloud-gateway-dependencies/pom.xml +++ b/spring-cloud-gateway-dependencies/pom.xml @@ -6,12 +6,12 @@ spring-cloud-dependencies-parent org.springframework.cloud - 2.1.6.RELEASE + 2.1.7.BUILD-SNAPSHOT spring-cloud-gateway-dependencies - 2.1.2.RELEASE + 2.1.3.BUILD-SNAPSHOT pom spring-cloud-gateway-dependencies diff --git a/spring-cloud-gateway-mvc/pom.xml b/spring-cloud-gateway-mvc/pom.xml index e0327f2d..1698323f 100644 --- a/spring-cloud-gateway-mvc/pom.xml +++ b/spring-cloud-gateway-mvc/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.RELEASE + 2.1.3.BUILD-SNAPSHOT .. diff --git a/spring-cloud-gateway-sample/pom.xml b/spring-cloud-gateway-sample/pom.xml index 91bd5bc8..c08f87e6 100644 --- a/spring-cloud-gateway-sample/pom.xml +++ b/spring-cloud-gateway-sample/pom.xml @@ -16,7 +16,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.RELEASE + 2.1.3.BUILD-SNAPSHOT .. diff --git a/spring-cloud-gateway-webflux/pom.xml b/spring-cloud-gateway-webflux/pom.xml index cfa78666..ed1ace30 100644 --- a/spring-cloud-gateway-webflux/pom.xml +++ b/spring-cloud-gateway-webflux/pom.xml @@ -11,7 +11,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.RELEASE + 2.1.3.BUILD-SNAPSHOT .. diff --git a/spring-cloud-starter-gateway/pom.xml b/spring-cloud-starter-gateway/pom.xml index 7426c9f9..fc4e9ae9 100644 --- a/spring-cloud-starter-gateway/pom.xml +++ b/spring-cloud-starter-gateway/pom.xml @@ -6,7 +6,7 @@ org.springframework.cloud spring-cloud-gateway - 2.1.2.RELEASE + 2.1.3.BUILD-SNAPSHOT .. spring-cloud-starter-gateway From 9eea694f9f8fba82a0b8974149544b6137b8fa95 Mon Sep 17 00:00:00 2001 From: Ryan Baxter Date: Mon, 24 Jun 2019 11:27:02 -0400 Subject: [PATCH 3/3] Get ASCII string in netty routing filter. Fixes #1132. --- .../cloud/gateway/filter/NettyRoutingFilter.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/NettyRoutingFilter.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/NettyRoutingFilter.java index 5ad44caa..08b34587 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/NettyRoutingFilter.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/NettyRoutingFilter.java @@ -107,7 +107,7 @@ public class NettyRoutingFilter implements GlobalFilter, Ordered { ServerHttpRequest request = exchange.getRequest(); final HttpMethod method = HttpMethod.valueOf(request.getMethodValue()); - final String url = requestUrl.toString(); + final String url = requestUrl.toASCIIString(); HttpHeaders filtered = filterRequest(getHeadersFilters(), exchange);