From 26540192f59db53504aedf4f29a16d3fe86d5af6 Mon Sep 17 00:00:00 2001 From: "ivan.baricic" Date: Wed, 27 Nov 2024 13:36:45 +0100 Subject: [PATCH] Apply TrimmedStringConverter to proxyAddress configuration property --- .../io/quarkus/restclient/config/RestClientsConfig.java | 6 ++++-- .../resources/configuration-test-application.properties | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsConfig.java b/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsConfig.java index 2019f5ab507a4..d5bfb8d86a5ab 100644 --- a/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsConfig.java +++ b/extensions/resteasy-classic/rest-client-config/runtime/src/main/java/io/quarkus/restclient/config/RestClientsConfig.java @@ -15,9 +15,11 @@ import io.quarkus.runtime.annotations.ConfigPhase; import io.quarkus.runtime.annotations.ConfigRoot; import io.quarkus.runtime.configuration.MemorySize; +import io.quarkus.runtime.configuration.TrimmedStringConverter; import io.smallrye.config.ConfigMapping; import io.smallrye.config.ConfigValue; import io.smallrye.config.SmallRyeConfig; +import io.smallrye.config.WithConverter; import io.smallrye.config.WithDefault; import io.smallrye.config.WithDefaults; import io.smallrye.config.WithKeys; @@ -58,7 +60,7 @@ public interface RestClientsConfig { *

* Can be overwritten by client-specific settings. */ - Optional proxyAddress(); + Optional<@WithConverter(TrimmedStringConverter.class) String> proxyAddress(); /** * Proxy username, equivalent to the http.proxy or https.proxy JVM settings. @@ -449,7 +451,7 @@ default Optional uriReload() { *

* Use `none` to disable proxy */ - Optional proxyAddress(); + Optional<@WithConverter(TrimmedStringConverter.class) String> proxyAddress(); /** * Proxy username. diff --git a/extensions/resteasy-reactive/rest-client/deployment/src/test/resources/configuration-test-application.properties b/extensions/resteasy-reactive/rest-client/deployment/src/test/resources/configuration-test-application.properties index 3a63d5e414381..e17a2f04f74e2 100644 --- a/extensions/resteasy-reactive/rest-client/deployment/src/test/resources/configuration-test-application.properties +++ b/extensions/resteasy-reactive/rest-client/deployment/src/test/resources/configuration-test-application.properties @@ -27,7 +27,8 @@ quarkus.rest-client.client-prefix.providers=io.quarkus.rest.client.reactive.Hell quarkus.rest-client.client-prefix.connect-timeout=5000 quarkus.rest-client.client-prefix.read-timeout=6000 quarkus.rest-client.client-prefix.follow-redirects=true -quarkus.rest-client.client-prefix.proxy-address=localhost:8080 +# intentionally add whitespace at the end to ensure we strip it +quarkus.rest-client.client-prefix.proxy-address=localhost:8080 quarkus.rest-client.client-prefix.query-param-style=COMMA_SEPARATED quarkus.rest-client.client-prefix.connection-ttl=30000 quarkus.rest-client.client-prefix.connection-pool-size=10