Skip to content

Commit 2618620

Browse files
siom79bclozel
authored andcommitted
Use system properties in ReactorClientHttpRequestFactory
Closes gh-34850 Signed-off-by: Martin Mois <martin.mois@gmail.com>
1 parent 680094d commit 2618620

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spring-web/src/main/java/org/springframework/http/client/ReactorClientHttpRequestFactory.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ public class ReactorClientHttpRequestFactory implements ClientHttpRequestFactory
4949
private static final Log logger = LogFactory.getLog(ReactorClientHttpRequestFactory.class);
5050

5151
private static final Function<HttpClient, HttpClient> defaultInitializer =
52-
client -> client.compress(true).responseTimeout(Duration.ofSeconds(10));
52+
client -> client.compress(true)
53+
.responseTimeout(Duration.ofSeconds(10))
54+
.proxyWithSystemProperties();
5355

5456

5557
private final @Nullable ReactorResourceFactory resourceFactory;
@@ -69,7 +71,8 @@ public class ReactorClientHttpRequestFactory implements ClientHttpRequestFactory
6971

7072
/**
7173
* Constructor with default client, created via {@link HttpClient#create()},
72-
* and with {@link HttpClient#compress compression} enabled.
74+
* and with {@link HttpClient#compress compression} and
75+
* {@link HttpClient#proxyWithSystemProperties() proxyWithSystemProperties} enabled.
7376
*/
7477
public ReactorClientHttpRequestFactory() {
7578
this(defaultInitializer.apply(HttpClient.create()));

0 commit comments

Comments
 (0)