tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r1156533 - in /tomcat/tc7.0.x/trunk: ./ java/org/apache/catalina/connector/LocalStrings.properties java/org/apache/catalina/connector/Response.java webapps/docs/changelog.xml
Date Thu, 11 Aug 2011 08:31:38 GMT
Author: markt
Date: Thu Aug 11 08:31:38 2011
New Revision: 1156533

URL: http://svn.apache.org/viewvc?rev=1156533&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41718
RFC2616 says redirects should include a response body.

Modified:
    tomcat/tc7.0.x/trunk/   (props changed)
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties
    tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java
    tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml

Propchange: tomcat/tc7.0.x/trunk/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Aug 11 08:31:38 2011
@@ -1 +1 @@
-/tomcat/trunk:1156171,1156276,1156304
+/tomcat/trunk:1156171,1156276,1156304,1156530

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties?rev=1156533&r1=1156532&r2=1156533&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/LocalStrings.properties Thu Aug
11 08:31:38 2011
@@ -47,6 +47,7 @@ coyoteResponse.reset.ise=Cannot call res
 coyoteResponse.resetBuffer.ise=Cannot reset buffer after response has been committed
 coyoteResponse.sendError.ise=Cannot call sendError() after the response has been committed
 coyoteResponse.sendRedirect.ise=Cannot call sendRedirect() after the response has been committed
+coyoteResponse.sendRedirect.note=<html><body><p>Redirecting to <a href="{0}">{0}</a></p></body></html>
 coyoteResponse.setBufferSize.ise=Cannot change buffer size after data has been written
 
 #

Modified: tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java?rev=1156533&r1=1156532&r2=1156533&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java (original)
+++ tomcat/tc7.0.x/trunk/java/org/apache/catalina/connector/Response.java Thu Aug 11 08:31:38
2011
@@ -1327,13 +1327,17 @@ public class Response
             return; 
 
         // Clear any data content that has been buffered
-        resetBuffer();
+        resetBuffer(true);
 
         // Generate a temporary redirect to the specified location
         try {
             String absolute = toAbsolute(location);
             setStatus(SC_FOUND);
             setHeader("Location", absolute);
+            PrintWriter writer = getWriter();
+            writer.print(
+                    sm.getString("coyoteResponse.sendRedirect.note", absolute));
+            flushBuffer();
         } catch (IllegalArgumentException e) {
             setStatus(SC_NOT_FOUND);
         }

Modified: tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml
URL: http://svn.apache.org/viewvc/tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml?rev=1156533&r1=1156532&r2=1156533&view=diff
==============================================================================
--- tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/tc7.0.x/trunk/webapps/docs/changelog.xml Thu Aug 11 08:31:38 2011
@@ -57,6 +57,10 @@
   <subsection name="Catalina">
     <changelog>
       <add>
+        <bug>41718</bug>: Include a response body when sending a redirect.
+        (markt)
+      </add>
+      <add>
         <bug>51640</bug>: Improve the memory leak prevention for leaks triggered
         by java.sql.DriverManager. (markt)
       </add>



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


Mime
View raw message