Skip to content

Commit 0cf5005

Browse files
committed
Apply abortOnCancel in JettyClientHttpConnector
This new option allows a cancel signal to abort the request, which is how we expect a connection to be aborted in a reactive chain that involves the WebClient. Closes gh-26287
1 parent f07fc76 commit 0cf5005

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-web/src/main/java/org/springframework/http/client/reactive/JettyClientHttpConnector.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ public Mono<ClientHttpResponse> connect(HttpMethod method, URI uri,
123123
Request request = this.httpClient.newRequest(uri).method(method.toString());
124124

125125
return requestCallback.apply(new JettyClientHttpRequest(request, this.bufferFactory))
126-
.then(Mono.fromDirect(ReactiveRequest.newBuilder(request).build()
126+
.then(Mono.fromDirect(ReactiveRequest.newBuilder(request).abortOnCancel(true).build()
127127
.response((reactiveResponse, chunkPublisher) -> {
128128
Flux<DataBuffer> content = Flux.from(chunkPublisher).map(this::toDataBuffer);
129129
return Mono.just(new JettyClientHttpResponse(reactiveResponse, content));

0 commit comments

Comments
 (0)