You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2001/09/28 23:46:03 UTC

DO NOT REPLY [Bug 3878] New: - Multiple Content-Type and Content-Length headers in response

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3878>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=3878

Multiple Content-Type and Content-Length headers in response

           Summary: Multiple Content-Type and Content-Length headers in
                    response
           Product: Tomcat 4
           Version: 4.0 Final
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Catalina
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: carlh@uievolution.com


The following servlet will generate an HTTP response with two Content-Type 
headers and two Content-Length headers.

    import javax.servlet.http.*;

    public class HeaderBug extends HttpServlet {
        protected void doGet(HttpServletRequest request, HttpServletResponse 
response) {
            response.setHeader("Content-Type", "text/xml");
            response.setContentType("text/html");
            response.setIntHeader("Content-Length", 200);
            response.setContentLength(100);
        }
    }

It looks like the way HttpResponseBase.setHeader() HttpResponseBase.sendHeaders
() are treating these two headers doesn't play well with 
ResponseBase.setContentType() and ResponseBase.setContentLength().