diff --git a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/NettyRoutingFilter.java b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/NettyRoutingFilter.java index f28775e22..53279d023 100644 --- a/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/NettyRoutingFilter.java +++ b/spring-cloud-gateway-core/src/main/java/org/springframework/cloud/gateway/filter/NettyRoutingFilter.java @@ -100,10 +100,8 @@ public class NettyRoutingFilter implements GlobalFilter, Ordered { boolean preserveHost = exchange.getAttributeOrDefault(PRESERVE_HOST_HEADER_ATTRIBUTE, false); - HttpClient client = chunkedTransfer? this.httpClient.chunkedTransfer() : - this.httpClient.noChunkedTransfer(); - - Flux responseFlux = client + Flux responseFlux = this.httpClient + .chunkedTransfer(chunkedTransfer) .request(method) .uri(url) .send((req, nettyOutbound) -> {