This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new 97c58599b2 Relocate the useCompression check and apply parts back to back. 97c58599b2 is described below commit 97c58599b25107d5b5cc19dd199a4fa847e99358 Author: shin-mallang <huipul...@naver.com> AuthorDate: Sat Sep 9 22:09:03 2023 +0900 Relocate the useCompression check and apply parts back to back. --- java/org/apache/coyote/http11/Http11Processor.java | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/java/org/apache/coyote/http11/Http11Processor.java b/java/org/apache/coyote/http11/Http11Processor.java index db2286d2b0..f274472347 100644 --- a/java/org/apache/coyote/http11/Http11Processor.java +++ b/java/org/apache/coyote/http11/Http11Processor.java @@ -915,12 +915,6 @@ public class Http11Processor extends AbstractProcessor { prepareSendfile(outputFilters); } - // Check for compression - boolean useCompression = false; - if (entityBody && sendfileData == null) { - useCompression = protocol.useCompression(request, response); - } - MimeHeaders headers = response.getMimeHeaders(); // A SC_NO_CONTENT response may include entity headers if (entityBody || statusCode == HttpServletResponse.SC_NO_CONTENT) { @@ -957,8 +951,11 @@ public class Http11Processor extends AbstractProcessor { } } - if (useCompression) { - outputBuffer.addActiveFilter(outputFilters[Constants.GZIP_FILTER]); + // Check for compression + if (entityBody && sendfileData == null) { + if (protocol.useCompression(request, response)) { + outputBuffer.addActiveFilter(outputFilters[Constants.GZIP_FILTER]); + } } // Add date header unless application has already set one (e.g. in a --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org