This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new b742e65d63 69476: Catch possible ISE when reporting PUT failure
b742e65d63 is described below
commit b742e65d6399e7d9834c065856a496185bc98451
Author: remm <[email protected]>
AuthorDate: Wed Nov 27 09:44:39 2024 +0100
69476: Catch possible ISE when reporting PUT failure
---
java/org/apache/catalina/servlets/DefaultServlet.java | 6 +++++-
webapps/docs/changelog.xml | 4 ++++
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/servlets/DefaultServlet.java
b/java/org/apache/catalina/servlets/DefaultServlet.java
index d416784f80..d2122b8532 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -617,7 +617,11 @@ public class DefaultServlet extends HttpServlet {
resp.setStatus(HttpServletResponse.SC_CREATED);
}
} else {
- resp.sendError(HttpServletResponse.SC_CONFLICT);
+ try {
+ resp.sendError(HttpServletResponse.SC_CONFLICT);
+ } catch (IllegalStateException e) {
+ // Already committed, ignore
+ }
}
} finally {
if (resourceInputStream != null) {
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index be3f95e641..21c9e338e9 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -183,6 +183,10 @@
references to <code>application/x-www-form-urlencoded</code>. Based on
pull request <pr>779</pr> by Chenjp. (markt)
</add>
+ <fix>
+ <bug>69476</bug>: Catch possible ISE when trying to report PUT failure
+ in the <code>DefaultServlet</code>. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]