Add channel check before dispose which may cause reactor-netty PrematureCloseException
Fixes gh-2046 Fixes gh-2093
This commit is contained in:
@@ -123,7 +123,8 @@ public class NettyWriteResponseFilter implements GlobalFilter, Ordered {
|
||||
|
||||
private void cleanup(ServerWebExchange exchange) {
|
||||
Connection connection = exchange.getAttribute(CLIENT_RESPONSE_CONN_ATTR);
|
||||
if (connection != null) {
|
||||
if (connection != null && connection.channel().isActive()
|
||||
&& !connection.isPersistent()) {
|
||||
connection.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user