tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 3878] New: - Multiple Content-Type and Content-Length headers in response
Date Fri, 28 Sep 2001 21:46:03 GMT
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().

Mime
View raw message