Skip to content

Commit edb5937

Browse files
committed
Merge branch '2.1.x'
2 parents 5c4537a + 0b828db commit edb5937

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

spring-boot-project/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/reactive/error/AbstractErrorWebExceptionHandler.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ public abstract class AbstractErrorWebExceptionHandler
6464
* Currently duplicated from Spring WebFlux HttpWebHandlerAdapter.
6565
*/
6666
private static final Set<String> DISCONNECTED_CLIENT_EXCEPTIONS = new HashSet<>(
67-
Arrays.asList("ClientAbortException", "EOFException", "EofException"));
67+
Arrays.asList("AbortedException", "ClientAbortException", "EOFException",
68+
"EofException"));
6869

6970
private static final Log logger = HttpLogging
7071
.forLogName(AbstractErrorWebExceptionHandler.class);
@@ -268,8 +269,12 @@ public Mono<Void> handle(ServerWebExchange exchange, Throwable throwable) {
268269

269270
private boolean isDisconnectedClientError(Throwable ex) {
270271
String message = NestedExceptionUtils.getMostSpecificCause(ex).getMessage();
271-
if (message != null && message.toLowerCase().contains("broken pipe")) {
272-
return true;
272+
if (message != null) {
273+
String text = message.toLowerCase();
274+
if (text.contains("broken pipe")
275+
|| text.contains("connection reset by peer")) {
276+
return true;
277+
}
273278
}
274279
return DISCONNECTED_CLIENT_EXCEPTIONS.contains(ex.getClass().getSimpleName());
275280
}

0 commit comments

Comments
 (0)