This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 9.0.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push: new 0ca1ae14d8 Refactor. Simplify logic. No functional change. 0ca1ae14d8 is described below commit 0ca1ae14d8a857dee97e62053c177eaa799d552c Author: Mark Thomas <ma...@apache.org> AuthorDate: Mon Mar 6 19:41:32 2023 +0000 Refactor. Simplify logic. No functional change. --- java/org/apache/coyote/ajp/AjpProcessor.java | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/java/org/apache/coyote/ajp/AjpProcessor.java b/java/org/apache/coyote/ajp/AjpProcessor.java index 1b5d311836..6b4a203e91 100644 --- a/java/org/apache/coyote/ajp/AjpProcessor.java +++ b/java/org/apache/coyote/ajp/AjpProcessor.java @@ -957,19 +957,10 @@ public class AjpProcessor extends AbstractProcessor { responseMessage.reset(); responseMessage.appendByte(Constants.JK_AJP13_SEND_HEADERS); - // Responses with certain status codes are not permitted to include a - // response body. + // Responses with certain status codes and/or methods are not permitted to include a response body. int statusCode = response.getStatus(); - if (statusCode < 200 || statusCode == 204 || statusCode == 205 || - statusCode == 304) { - // No entity body - swallowResponse = true; - } - - // Responses to HEAD requests are not permitted to include a response - // body. - MessageBytes methodMB = request.method(); - if (methodMB.equals("HEAD")) { + if (statusCode < 200 || statusCode == 204 || statusCode == 205 || statusCode == 304 || + request.method().equals("HEAD")) { // No entity body swallowResponse = true; } --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org