You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Kevin Seguin <se...@motive.com> on 2002/05/02 05:20:43 UTC

[coyote/tomcat 3.3.1] content-length header never set?

i was playing around with coyote (v1.0-b8) and tomcat 3.3.1 and i noticed that setting a content-length header had absolutely no effect.  in other words, if i set a content-length header in a servlet, the http client would never see this header.  i dug around through the code a little and discovered that the following patch fixed this.  now, i really don't know anything about the tomcat 3 internals, or coyote, so, i really don't know how "right" this is :)

Index: Tomcat3Response.java
===================================================================
RCS file: /home/cvs/jakarta-tomcat-connectors/coyote/src/java/org/apache/coyote/tomcat3/Tomcat3Response.java,v
retrieving revision 1.3
diff -u -w -r1.3 Tomcat3Response.java
--- Tomcat3Response.java	9 Apr 2002 18:37:24 -0000	1.3
+++ Tomcat3Response.java	2 May 2002 03:15:07 -0000
@@ -91,6 +91,11 @@
         super();
     }
 
+    public void setContentLength(int contentLength) {
+        super.setContentLength(contentLength);
+        coyoteResponse.setContentLength(contentLength);
+    }
+
     /** Attach a Coyote Request to this request.
      */
     public void setCoyoteResponse(org.apache.coyote.Response cRes) {

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>