Skip to content

Commit 1d5ffaf

Browse files
pokabsbrannen
authored andcommitted
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
1 parent c55606e commit 1d5ffaf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class DefaultWebClient implements WebClient {
6868
private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate";
6969

7070
private static final Mono<ClientResponse> NO_HTTP_CLIENT_RESPONSE_ERROR = Mono.error(
71-
new IllegalStateException("The underlying HTTP client completed without emitting a response."));
71+
() -> new IllegalStateException("The underlying HTTP client completed without emitting a response."));
7272

7373

7474
private final ExchangeFunction exchangeFunction;

0 commit comments

Comments
 (0)