This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git

commit 6f077bb20a95447cab06e37ab895cea5f725c115
Author: opencode <[email protected]>
AuthorDate: Wed Oct 7 11:39:55 2026 +0200

    Stop rendering the host list page twice in the HTML host manager
    
    For a POST request with an unknown command, doPost handed the request
    off to doGet - which renders the full page and closes the response
    writer - and then rendered the list page a second time. The second
    document was written to the closed output buffer and silently
    discarded.
    
    Return after delegating to doGet, matching the long-standing pattern in
    the sibling HTMLManagerServlet, so nothing is rendered after the
    delegated GET handling.
---
 java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java 
b/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
index 41debd06e2..3db1272af8 100644
--- a/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
+++ b/java/org/apache/catalina/manager/host/HTMLHostManagerServlet.java
@@ -122,8 +122,11 @@ public class HTMLHostManagerServlet extends 
HostManagerServlet {
         } else if (command.equals("/persist")) {
             message = persist(smClient);
         } else {
-            // Try GET
+            // Try GET. The GET handling renders the response in full, so
+            // nothing must be rendered afterwards to avoid writing a second
+            // document on the closed writer.
             doGet(request, response);
+            return;
         }
 
         list(request, response, message, smClient);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to