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 c3eb218eb6 Refactor. Simplify logic. No functional change. c3eb218eb6 is described below commit c3eb218eb67655e1b1faacb0c1964746809f6f59 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 3d50ae89b5..2b547e0312 100644 --- a/java/org/apache/coyote/ajp/AjpProcessor.java +++ b/java/org/apache/coyote/ajp/AjpProcessor.java @@ -966,19 +966,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