Skip to content

Commit

Permalink
Always construct new exception on error in DefaultWebClient
Browse files Browse the repository at this point in the history
Always construct new exception on error, otherwise memory leak may
occur due to repeated use of singleton exception.

Closes gh-28550
  • Loading branch information
pokab authored and sbrannen committed Jun 1, 2022
1 parent c55606e commit 1d5ffaf
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -68,7 +68,7 @@ class DefaultWebClient implements WebClient {
private static final String URI_TEMPLATE_ATTRIBUTE = WebClient.class.getName() + ".uriTemplate";

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;
Expand Down

0 comments on commit 1d5ffaf

Please sign in to comment.