EurekaLoadBalancingExchangeFilterFunction implements ExchangeFilterFunction { @VisibleForTesting static URI rewrite(URI original, InstanceInfo instance) { URI effectiveUri; if (original.getScheme().equals(EUREKA_SCHEMA)) { boolean secure = StringExt.isNotEmpty(original.getQuery()) && asList(original.getQuery().split("&")).contains("secure=true"); try { effectiveUri = new URI((secure ? "https" : "http") + original.toString().substring(EUREKA_SCHEMA.length())); } catch (URISyntaxException e) { effectiveUri = original; } } else { effectiveUri = original; } return UriBuilder.fromUri(effectiveUri).host(instance.getIPAddr()).build(); } EurekaLoadBalancingExchangeFilterFunction(EurekaClient eurekaClient,
                                                     Function<URI, String> vipExtractor,
                                                     TitusRuntime titusRuntime); @Override Mono<ClientResponse> filter(ClientRequest request, ExchangeFunction next);  }
@Test public void testUriRewrite() throws URISyntaxException { assertThat(rewrite(new URI("eureka: assertThat(rewrite(new URI("eureka: assertThat(rewrite(new URI("eureka: assertThat(rewrite(new URI("eureka: }