This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new e7907646bd 69476: Catch possible ISE when reporting PUT failure
e7907646bd is described below
commit e7907646bd7e2ca5a0bd52e0396a6870ee4e4f34
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 dba91ad1b4..d1cc9b1c43 100644
--- a/java/org/apache/catalina/servlets/DefaultServlet.java
+++ b/java/org/apache/catalina/servlets/DefaultServlet.java
@@ -627,7 +627,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 5f9d227cc8..ac482e53a8 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]