Author: markt Date: Tue Aug 12 02:09:39 2008 New Revision: 685099 URL: http://svn.apache.org/viewvc?rev=685099&view=rev Log: Fix bug 44562. HEAD requests fail with rd.include(). Patch provided by David Jencks.
Modified: tomcat/container/branches/tc4.1.x/RELEASE-NOTES-4.1.txt tomcat/current/tc4.1.x/STATUS.txt tomcat/servletapi/branches/servlet2.3-jsp1.2-tc4.x/src/share/javax/servlet/http/HttpServlet.java Modified: tomcat/container/branches/tc4.1.x/RELEASE-NOTES-4.1.txt URL: http://svn.apache.org/viewvc/tomcat/container/branches/tc4.1.x/RELEASE-NOTES-4.1.txt?rev=685099&r1=685098&r2=685099&view=diff ============================================================================== --- tomcat/container/branches/tc4.1.x/RELEASE-NOTES-4.1.txt (original) +++ tomcat/container/branches/tc4.1.x/RELEASE-NOTES-4.1.txt Tue Aug 12 02:09:39 2008 @@ -1733,6 +1733,9 @@ [4.1.38] #41217 SSO cookies are now marked as secure. This is CVE-2008-0128. +[4.1.38] #44562 + HEAD requests failed with rd.include(). Patch provided by David Jencks. + ---------------- Coyote Bug Fixes: Modified: tomcat/current/tc4.1.x/STATUS.txt URL: http://svn.apache.org/viewvc/tomcat/current/tc4.1.x/STATUS.txt?rev=685099&r1=685098&r2=685099&view=diff ============================================================================== --- tomcat/current/tc4.1.x/STATUS.txt (original) +++ tomcat/current/tc4.1.x/STATUS.txt Tue Aug 12 02:09:39 2008 @@ -25,12 +25,6 @@ PATCHES PROPOSED TO BACKPORT: [ New proposals should be added at the end of the list ] -* Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=44562 - http://svn.apache.org/viewvc?rev=635294&view=rev (prior code clean up) - http://svn.apache.org/viewvc?rev=635297&view=rev (the actual fix) - +1: markt, yoavs, funkman - -1: - * Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45301 Remove a JDK 1.4 dep for the few users that still run TC4 on 1.3 JDKs http://people.apache.org/~markt/patches/2008-07-07-bug45301-tc4.patch Modified: tomcat/servletapi/branches/servlet2.3-jsp1.2-tc4.x/src/share/javax/servlet/http/HttpServlet.java URL: http://svn.apache.org/viewvc/tomcat/servletapi/branches/servlet2.3-jsp1.2-tc4.x/src/share/javax/servlet/http/HttpServlet.java?rev=685099&r1=685098&r2=685099&view=diff ============================================================================== --- tomcat/servletapi/branches/servlet2.3-jsp1.2-tc4.x/src/share/javax/servlet/http/HttpServlet.java (original) +++ tomcat/servletapi/branches/servlet2.3-jsp1.2-tc4.x/src/share/javax/servlet/http/HttpServlet.java Tue Aug 12 02:09:39 2008 @@ -723,149 +723,50 @@ /* - * A response that includes no body, for use in (dumb) "HEAD" support. + * A response wrapper for use in (dumb) "HEAD" support. * This just swallows that body, counting the bytes in order to set - * the content length appropriately. All other methods delegate directly - * to the HTTP Servlet Response object used to construct this one. + * the content length appropriately. All other methods delegate to the + * wrapped HTTP Servlet Response object. */ // file private -class NoBodyResponse implements HttpServletResponse { - private HttpServletResponse resp; +class NoBodyResponse extends HttpServletResponseWrapper { private NoBodyOutputStream noBody; private PrintWriter writer; private boolean didSetContentLength; // file private NoBodyResponse(HttpServletResponse r) { - resp = r; + super(r); noBody = new NoBodyOutputStream(); } // file private void setContentLength() { if (!didSetContentLength) - resp.setContentLength(noBody.getContentLength()); + super.setContentLength(noBody.getContentLength()); } // SERVLET RESPONSE interface methods public void setContentLength(int len) { - resp.setContentLength(len); + super.setContentLength(len); didSetContentLength = true; } - public void setContentType(String type) - { resp.setContentType(type); } - - public ServletOutputStream getOutputStream() throws IOException - { return noBody; } - - public String getCharacterEncoding() - { return resp.getCharacterEncoding(); } + public ServletOutputStream getOutputStream() throws IOException { + return noBody; + } - public PrintWriter getWriter() throws UnsupportedEncodingException - { + public PrintWriter getWriter() throws UnsupportedEncodingException { if (writer == null) { - OutputStreamWriter w; + OutputStreamWriter w; w = new OutputStreamWriter(noBody, getCharacterEncoding()); writer = new PrintWriter(w); } return writer; } - - public void setBufferSize(int size) throws IllegalStateException - { resp.setBufferSize(size); } - - public int getBufferSize() - { return resp.getBufferSize(); } - - public void reset() throws IllegalStateException - { resp.reset(); } - - public void resetBuffer() throws IllegalStateException - { resp.resetBuffer(); } - - public boolean isCommitted() - { return resp.isCommitted(); } - - public void flushBuffer() throws IOException - { resp.flushBuffer(); } - - public void setLocale(Locale loc) - { resp.setLocale(loc); } - - public Locale getLocale() - { return resp.getLocale(); } - - - // HTTP SERVLET RESPONSE interface methods - - public void addCookie(Cookie cookie) - { resp.addCookie(cookie); } - - public boolean containsHeader(String name) - { return resp.containsHeader(name); } - - /** @deprecated */ - public void setStatus(int sc, String sm) - { resp.setStatus(sc, sm); } - - public void setStatus(int sc) - { resp.setStatus(sc); } - - public void setHeader(String name, String value) - { resp.setHeader(name, value); } - - public void setIntHeader(String name, int value) - { resp.setIntHeader(name, value); } - - public void setDateHeader(String name, long date) - { resp.setDateHeader(name, date); } - - public void sendError(int sc, String msg) throws IOException - { resp.sendError(sc, msg); } - - public void sendError(int sc) throws IOException - { resp.sendError(sc); } - - public void sendRedirect(String location) throws IOException - { resp.sendRedirect(location); } - - public String encodeURL(String url) - { return resp.encodeURL(url); } - - public String encodeRedirectURL(String url) - { return resp.encodeRedirectURL(url); } - - public void addHeader(String name, String value) - { resp.addHeader(name, value); } - - public void addDateHeader(String name, long value) - { resp.addDateHeader(name, value); } - - public void addIntHeader(String name, int value) - { resp.addIntHeader(name, value); } - - - /** - * @deprecated As of Version 2.1, replaced by - * [EMAIL PROTECTED] HttpServletResponse#encodeURL}. - * - */ - public String encodeUrl(String url) - { return this.encodeURL(url); } - - - /** - * @deprecated As of Version 2.1, replaced by - * [EMAIL PROTECTED] HttpServletResponse#encodeRedirectURL}. - * - */ - public String encodeRedirectUrl(String url) - { return this.encodeRedirectURL(url); } - } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]