Merge branch '4.1.x'

This commit is contained in:
spencergibb
2024-09-26 16:39:22 -04:00

View File

@@ -191,7 +191,8 @@ public class NettyRoutingFilter implements GlobalFilter, Ordered {
if (responseTimeout != null) {
responseFlux = responseFlux
.timeout(responseTimeout,
Mono.error(new TimeoutException("Response took longer than timeout: " + responseTimeout)))
Mono.defer(() -> Mono
.error(new TimeoutException("Response took longer than timeout: " + responseTimeout))))
.onErrorMap(TimeoutException.class,
th -> new ResponseStatusException(HttpStatus.GATEWAY_TIMEOUT, th.getMessage(), th));
}