BZ45026: Never return an empty HTTP status response phrase.
authorrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 24 Mar 2009 10:57:38 +0000 (10:57 +0000)
committerrjung <rjung@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 24 Mar 2009 10:57:38 +0000 (10:57 +0000)
mod_jk and httpd 2.x do not like that.

Addition to r697183.

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@757721 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/coyote/ajp/AjpAprProcessor.java
java/org/apache/coyote/ajp/AjpProcessor.java
webapps/docs/changelog.xml

index c0ea67b..6ec6ca0 100644 (file)
@@ -961,6 +961,10 @@ public class AjpAprProcessor implements ActionHook {
         } else {
             message = message.replace('\n', ' ').replace('\r', ' ');
         }
+        if (message == null) {
+            // mod_jk + httpd 2.x fails with a null status message - bug 45026
+            message = Integer.toString(response.getStatus());
+        }
         tmpMB.setString(message);
         responseHeaderMessage.appendBytes(tmpMB);
 
index 3e6119a..7b166f3 100644 (file)
@@ -966,6 +966,10 @@ public class AjpProcessor implements ActionHook {
         } else {
             message = message.replace('\n', ' ').replace('\r', ' ');
         }
+        if (message == null) {
+            // mod_jk + httpd 2.x fails with a null status message - bug 45026
+            message = Integer.toString(response.getStatus());
+        }
         tmpMB.setString(message);
         responseHeaderMessage.appendBytes(tmpMB);
 
index 90a04f4..12dc923 100644 (file)
   </subsection>
   <subsection name="Coyote">
     <changelog>
+      <fix>
+        <bug>45026</bug>: Never return an empty HTTP status response phrase.
+        mod_jk and httpd 2.x do not like that. (rjung)
+      </fix>
       <update>
         Allow bigger AJP packets also for request bodies and responses
         using the packetSize attribute of the Connector. (rjung)