diff --git a/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/filter/RouteToRequestUrlFilter.java b/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/filter/RouteToRequestUrlFilter.java index 35c1a77c6e..2702677180 100644 --- a/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/filter/RouteToRequestUrlFilter.java +++ b/spring-cloud-gateway-server/src/main/java/org/springframework/cloud/gateway/filter/RouteToRequestUrlFilter.java @@ -79,8 +79,7 @@ public Mono filter(ServerWebExchange exchange, GatewayFilterChain chain) { if ("lb".equalsIgnoreCase(routeUri.getScheme()) && routeUri.getHost() == null) { // Load balanced URIs should always have a host. If the host is null it is - // most - // likely because the host name was invalid (for example included an + // most likely because the host name was invalid (for example included an // underscore) throw new IllegalStateException("Invalid host: " + routeUri.toString()); } diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerTestConfig.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerTestConfig.java index e96093c5ba..a09f92f5d0 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerTestConfig.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/filter/factory/SpringCloudCircuitBreakerTestConfig.java @@ -115,7 +115,7 @@ public RouteLocator circuitBreakerRouteLocator(RouteLocatorBuilder builder) { .uri(uri)) .route("circuitbreaker_connection_failure", r -> r.host("**.circuitbreakerconnectfail.org") .filters(f -> f.prefixPath("/httpbin").circuitBreaker(config -> { - })).uri("lb:badservice")) + })).uri("lb://badservice")) /* * This is a route encapsulated in a circuit breaker that is ready to wait * for a response far longer than the underpinning WebClient would. diff --git a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/route/RouteTests.java b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/route/RouteTests.java index b43800d8de..bca56902db 100644 --- a/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/route/RouteTests.java +++ b/spring-cloud-gateway-server/src/test/java/org/springframework/cloud/gateway/route/RouteTests.java @@ -55,7 +55,7 @@ public void nullScheme() { } @Test - public void emptyHostFails() { + public void localhostNoSchemeFails() { assertThatThrownBy(() -> Route.async().id("1").predicate(exchange -> true).uri("localhost:8080")) .isInstanceOf(IllegalArgumentException.class); }