Skip to content

Commit

Permalink
Do not set up CookieStore in Apache connector
Browse files Browse the repository at this point in the history
Closes gh-33822
  • Loading branch information
rstoyanchev committed Nov 14, 2024
1 parent 973d815 commit de8a94f
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import java.util.function.BiFunction;
import java.util.function.Function;

import org.apache.hc.client5.http.cookie.BasicCookieStore;
import org.apache.hc.client5.http.impl.async.CloseableHttpAsyncClient;
import org.apache.hc.client5.http.impl.async.HttpAsyncClients;
import org.apache.hc.client5.http.protocol.HttpClientContext;
Expand Down Expand Up @@ -107,12 +106,10 @@ public Mono<ClientHttpResponse> connect(HttpMethod method, URI uri,
Function<? super ClientHttpRequest, Mono<Void>> requestCallback) {

HttpClientContext context = this.contextProvider.apply(method, uri);
if (context.getCookieStore() == null) {
context.setCookieStore(new BasicCookieStore());
}

HttpComponentsClientHttpRequest request =
new HttpComponentsClientHttpRequest(method, uri, context, this.dataBufferFactory);

return requestCallback.apply(request).then(Mono.defer(() -> execute(request, context)));
}

Expand Down

0 comments on commit de8a94f

Please sign in to comment.