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 10610bc6c5 Refactor. Simplify logic. No functional change.
10610bc6c5 is described below
commit 10610bc6c556f283e4bd0ce027dd5bf20f913170
Author: Mark Thomas <[email protected]>
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 27f9eff1ad..e0ec70c0fe 100644
--- a/java/org/apache/coyote/ajp/AjpProcessor.java
+++ b/java/org/apache/coyote/ajp/AjpProcessor.java
@@ -1050,19 +1050,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: [email protected]
For additional commands, e-mail: [email protected]