From c3402e8d4447fb7014e9302608f7964f6e2143e6 Mon Sep 17 00:00:00 2001 From: Azalea <22280294+hykilpikonna@users.noreply.github.com> Date: Sat, 10 Feb 2024 05:29:53 -0500 Subject: [PATCH] [O] Ignore errors on EOF --- .../aqua/sega/general/filter/CompressionFilter.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/java/icu/samnyan/aqua/sega/general/filter/CompressionFilter.java b/src/main/java/icu/samnyan/aqua/sega/general/filter/CompressionFilter.java index 533530a3..c07009f4 100644 --- a/src/main/java/icu/samnyan/aqua/sega/general/filter/CompressionFilter.java +++ b/src/main/java/icu/samnyan/aqua/sega/general/filter/CompressionFilter.java @@ -1,6 +1,7 @@ package icu.samnyan.aqua.sega.general.filter; import icu.samnyan.aqua.sega.util.Compression; +import org.eclipse.jetty.io.EofException; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -64,8 +65,11 @@ protected void doFilterInternal(HttpServletRequest request, HttpServletResponse response.setContentType("application/json; charset=utf-8"); response.addHeader("Content-Encoding", "deflate"); - response.getOutputStream().write(respResult); - + try { + response.getOutputStream().write(respResult); + } catch (EofException e) { + logger.warn("Client closed connection"); + } } @Override