This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new bce0062a0c 69476: Catch possible ISE when reporting PUT failure
bce0062a0c is described below
commit bce0062a0c664e30c81257d4bf3a061912c82e3c
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 5cd2b78f31..ac15a51126 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -191,6 +191,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]