From: markt Date: Fri, 22 Jul 2011 18:09:54 +0000 (+0000) Subject: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41709 X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=0c5ecb7a85c56562a960691bd65c089009a1000b;p=tomcat7.0 Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=41709 Provide exception messages for ISEs when response is already committed git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1149678 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/catalina/connector/LocalStrings.properties b/java/org/apache/catalina/connector/LocalStrings.properties index 1449a4477..034d9b09a 100644 --- a/java/org/apache/catalina/connector/LocalStrings.properties +++ b/java/org/apache/catalina/connector/LocalStrings.properties @@ -44,6 +44,7 @@ coyoteAdapter.accesslogFail=Exception while attempting to add an entry to the ac # coyoteResponse.getOutputStream.ise=getWriter() has already been called for this response coyoteResponse.getWriter.ise=getOutputStream() has already been called for this response +coyoteResponse.reset.ise=Cannot call reset() after response has been committed 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 diff --git a/java/org/apache/catalina/connector/ResponseFacade.java b/java/org/apache/catalina/connector/ResponseFacade.java index 0f5d79461..13a7c046d 100644 --- a/java/org/apache/catalina/connector/ResponseFacade.java +++ b/java/org/apache/catalina/connector/ResponseFacade.java @@ -250,7 +250,7 @@ public class ResponseFacade if (isCommitted()) throw new IllegalStateException - (/*sm.getString("responseBase.reset.ise")*/); + (sm.getString("coyoteResponse.setBufferSize.ise")); response.setBufferSize(size); @@ -311,7 +311,7 @@ public class ResponseFacade if (isCommitted()) throw new IllegalStateException - (/*sm.getString("responseBase.reset.ise")*/); + (sm.getString("coyoteResponse.resetBuffer.ise")); response.resetBuffer(); @@ -335,7 +335,7 @@ public class ResponseFacade if (isCommitted()) throw new IllegalStateException - (/*sm.getString("responseBase.reset.ise")*/); + (sm.getString("coyoteResponse.reset.ise")); response.reset(); @@ -441,7 +441,7 @@ public class ResponseFacade if (isCommitted()) throw new IllegalStateException - (/*sm.getString("responseBase.reset.ise")*/); + (sm.getString("coyoteResponse.sendError.ise")); response.setAppCommitted(true); @@ -456,7 +456,7 @@ public class ResponseFacade if (isCommitted()) throw new IllegalStateException - (/*sm.getString("responseBase.reset.ise")*/); + (sm.getString("coyoteResponse.sendError.ise")); response.setAppCommitted(true); @@ -471,7 +471,7 @@ public class ResponseFacade if (isCommitted()) throw new IllegalStateException - (/*sm.getString("responseBase.reset.ise")*/); + (sm.getString("coyoteResponse.sendRedirect.ise")); response.setAppCommitted(true); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index e3b52df39..8cac95dc3 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -63,6 +63,11 @@ ignored when scanning jars for tag libraries. (kkolinko) + 41709: Provide exception messages where no message is + provided currently for IllegalStateExcpetions triggered by calling + HttpServletResponse methods when the reponse is committed. (markt) + + 51509: Fix potential concurrency issue in CSRF prevention filter that may lead to some requests failing that should not. (markt)