Skip to content

Commit

Permalink
Polishing
Browse files Browse the repository at this point in the history
  • Loading branch information
spencergibb committed Mar 12, 2024
1 parent c6dbf0e commit 54588c2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,7 @@ public Mono<Void> 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());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 54588c2

Please sign in to comment.