Skip to content

Commit 1694691

Browse files
committed
Default to JDK HttpClient if no others present
Closes gh-23432
1 parent fe8d42f commit 1694691

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Diff for: spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClientBuilder.java

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2020 the original author or authors.
2+
* Copyright 2002-2021 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -26,6 +26,7 @@
2626
import org.springframework.http.HttpHeaders;
2727
import org.springframework.http.client.reactive.ClientHttpConnector;
2828
import org.springframework.http.client.reactive.HttpComponentsClientHttpConnector;
29+
import org.springframework.http.client.reactive.JdkClientHttpConnector;
2930
import org.springframework.http.client.reactive.JettyClientHttpConnector;
3031
import org.springframework.http.client.reactive.ReactorClientHttpConnector;
3132
import org.springframework.http.codec.ClientCodecConfigurer;
@@ -294,7 +295,9 @@ else if (jettyClientPresent) {
294295
else if (httpComponentsClientPresent) {
295296
return new HttpComponentsClientHttpConnector();
296297
}
297-
throw new IllegalStateException("No suitable default ClientHttpConnector found");
298+
else {
299+
return new JdkClientHttpConnector();
300+
}
298301
}
299302

300303
private ExchangeStrategies initExchangeStrategies() {

0 commit comments

Comments
 (0)