You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2008/07/30 19:25:45 UTC

svn commit: r681133 - in /tomcat: container/tc5.5.x/webapps/docs/changelog.xml current/tc5.5.x/STATUS.txt servletapi/servlet2.4-jsp2.0-tc5.x/jsr154/src/share/javax/servlet/http/HttpServlet.java

Author: markt
Date: Wed Jul 30 10:25:45 2008
New Revision: 681133

URL: http://svn.apache.org/viewvc?rev=681133&view=rev
Log:
Fix bug 44562. HEAD requests cannot use includes. Patch provided by David Jencks.

Modified:
    tomcat/container/tc5.5.x/webapps/docs/changelog.xml
    tomcat/current/tc5.5.x/STATUS.txt
    tomcat/servletapi/servlet2.4-jsp2.0-tc5.x/jsr154/src/share/javax/servlet/http/HttpServlet.java

Modified: tomcat/container/tc5.5.x/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/container/tc5.5.x/webapps/docs/changelog.xml?rev=681133&r1=681132&r2=681133&view=diff
==============================================================================
--- tomcat/container/tc5.5.x/webapps/docs/changelog.xml (original)
+++ tomcat/container/tc5.5.x/webapps/docs/changelog.xml Wed Jul 30 10:25:45 2008
@@ -69,6 +69,10 @@
         Use a localised error message if a user tries to write a negative length
         byte array during default processing of a HEAD request. (markt)   
       </fix>
+      <fix>
+        <bug>44562</bug>: HEAD requests cannot use includes. Patch provided by
+          David Jencks. (markt)
+      </fix>
     </changelog>
   </subsection>
 </section>

Modified: tomcat/current/tc5.5.x/STATUS.txt
URL: http://svn.apache.org/viewvc/tomcat/current/tc5.5.x/STATUS.txt?rev=681133&r1=681132&r2=681133&view=diff
==============================================================================
--- tomcat/current/tc5.5.x/STATUS.txt (original)
+++ tomcat/current/tc5.5.x/STATUS.txt Wed Jul 30 10:25:45 2008
@@ -35,12 +35,6 @@
            the getClassloader() call. This call is only ever made if trace is
            enabled
 
-* 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, fhanik, yoavs
-  -1:
-
 * Fix docs re use of maxActive
   http://svn.apache.org/viewvc?rev=639842&view=rev
   +1: rjung, markt, fhanik, yoavs

Modified: tomcat/servletapi/servlet2.4-jsp2.0-tc5.x/jsr154/src/share/javax/servlet/http/HttpServlet.java
URL: http://svn.apache.org/viewvc/tomcat/servletapi/servlet2.4-jsp2.0-tc5.x/jsr154/src/share/javax/servlet/http/HttpServlet.java?rev=681133&r1=681132&r2=681133&view=diff
==============================================================================
--- tomcat/servletapi/servlet2.4-jsp2.0-tc5.x/jsr154/src/share/javax/servlet/http/HttpServlet.java (original)
+++ tomcat/servletapi/servlet2.4-jsp2.0-tc5.x/jsr154/src/share/javax/servlet/http/HttpServlet.java Wed Jul 30 10:25:45 2008
@@ -23,7 +23,6 @@
 import java.lang.reflect.Method;
 import java.text.MessageFormat;
 import java.util.Enumeration;
-import java.util.Locale;
 import java.util.ResourceBundle;
 
 import javax.servlet.GenericServlet;
@@ -733,146 +732,48 @@
 
 
 /*
- * A response that includes no body, for use in (dumb) "HEAD" support.
+ * A response wrapper for use in 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;
-    private NoBodyOutputStream                noBody;
-    private PrintWriter                        writer;
-    private boolean                        didSetContentLength;
+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 setCharacterEncoding(String charset)
-      { resp.setCharacterEncoding(charset); }
-
-    public void setContentType(String type)
-      { resp.setContentType(type); }
-
-    public String getContentType()
-      { return resp.getContentType(); }
-
-    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
-     *                  {@link HttpServletResponse#encodeURL}.
-     */
-    public String encodeUrl(String url) 
-      { return this.encodeURL(url); }
-
-    /**
-     * @deprecated  As of Version 2.1, replaced by
-     *                  {@link HttpServletResponse#encodeRedirectURL}.
-     */
-    public String encodeRedirectUrl(String url)
-      { return this.encodeRedirectURL(url); }
 }
 
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org