Browse Source

Always construct new exception on error in DefaultWebClient

Always construct new exception on error, otherwise memory leak may
occur due to repeated use of singleton exception.

Closes gh-28550
pull/28720/head
Balázs Póka 2 years ago committed by Sam Brannen
parent
commit
1d5ffaf30a
  1. 2
      spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java

2
spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClient.java

@ -68,7 +68,7 @@ class DefaultWebClient implements WebClient {
private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate"; private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate";
private static final Mono<ClientResponse> NO_HTTP_CLIENT_RESPONSE_ERROR = Mono.error( private static final Mono<ClientResponse> NO_HTTP_CLIENT_RESPONSE_ERROR = Mono.error(
new IllegalStateException("The underlying HTTP client completed without emitting a response.")); () -> new IllegalStateException("The underlying HTTP client completed without emitting a response."));
private final ExchangeFunction exchangeFunction; private final ExchangeFunction exchangeFunction;

Loading…
Cancel
Save