This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push: new 7abdf0b44c Relocate the useCompression check and apply parts back to back. 7abdf0b44c is described below commit 7abdf0b44c79f65c4f0fc862a1ea311f81ce881a 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 b8705441e8..ea810616d9 100644 --- a/java/org/apache/coyote/http11/Http11Processor.java +++ b/java/org/apache/coyote/http11/Http11Processor.java @@ -1140,12 +1140,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) { @@ -1177,8 +1171,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