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=20307>. 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=20307 Setting content length causes Tomcat to ignore response status Summary: Setting content length causes Tomcat to ignore response status Product: Tomcat 5 Version: Nightly Build Platform: All OS/Version: All Status: NEW Severity: Minor Priority: Other Component: Catalina AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] Setting the content length causes Tomcat to ignore subsequent status changes. As an example: import java.io.*; import javax.servlet.http.*; public class Test extends HttpServlet { protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException { response.setContentLength(0); response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.flushBuffer(); } } This results in a response code of 200 (OK) rather than 401 (Unauthorized). Doing: response.setStatus(HttpServletResponse.SC_UNAUTHORIZED); response.setContentLength(0); results in the correct response code being sent. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]