tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 384] New - AJP13 returns no Status Message (Reason-Phrase RFC 2616) BugRat Report#677
Date Tue, 13 Feb 2001 20:36:17 GMT
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=384

*** shadow/384	Tue Feb 13 12:36:17 2001
--- shadow/384.tmp.12503	Tue Feb 13 12:36:17 2001
***************
*** 0 ****
--- 1,64 ----
+ +============================================================================+
+ | AJP13 returns no Status Message (Reason-Phrase RFC 2616) BugRat Report#677 |
+ +----------------------------------------------------------------------------+
+ |        Bug #: 384                         Product: Tomcat 3                |
+ |       Status: UNCONFIRMED                 Version: Nightly Build           |
+ |   Resolution:                            Platform: All                     |
+ |     Severity: Normal                   OS/Version: All                     |
+ |     Priority: High                      Component: Connectors              |
+ +----------------------------------------------------------------------------+
+ |  Assigned To: danmil@shore.net                                             |
+ |  Reported By: rainer.jung@kippdata.de                                      |
+ |      CC list: Cc:                                                          |
+ +----------------------------------------------------------------------------+
+ |          URL:                                                              |
+ +============================================================================+
+ |                              DESCRIPTION                                   |
+ AJP13 returns only Status Code, but no Status Message
+ (aka Reason-Phrase as in RFC 2616)
+ 
+ In file service/copnnectors/Ajp13ConnectorResponse.java the code looks like:
+ 
+    122          MsgBuffer msg=con.getMsgBuffer();
+    123          msg.reset();
+    124          msg.appendByte(JK_AJP13_SEND_HEADERS);
+    125
+    126          msg.appendInt(getStatus());
+    127          msg.appendString("");
+    128
+    129          // No need for these two!!!
+    130          headers.removeHeader("Status");
+    131          headers.removeHeader("Servlet-Engine");
+ 
+ In line 127 the Status Message is just set to "". 
+ This does not conform to the HTTP protocol because
+ 
+ Status-Line = 
+ HTTP-Version SP Status-Code SP Reason-Phrase CRLF
+ 
+ This Reason-Phrase is missing 
+ (OK: to be precise in the RFCs the Phrase is allowed to be empty).
+ 
+ Instead one should use something like in file 
+ core/ResponseImpl.java
+ 
+ public class ResponseImpl implements Response {
+     protected static StringManager sm =
+         StringManager.getManager("org.apache.tomcat.core");
+ 
+ ...
+ 
+     // utility method - should be in a different class
+     public static String getMessage( int status ) {
+         return sm.getString("sc."+ status);
+     }
+ 
+ }
+ 
+ and then use getMessage to set the Status Message from the
+ Status Code. In fact everything is already prepared to do that,
+ including the table of codes and messages in core/LocalStrings.properties.
+ 
+ Anybody willing to officially do the fix?
+ 
+ Thanks!

Mime
View raw message