You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2026/04/13 13:05:55 UTC

(tomcat) branch main updated: Fix regression following fix for 69967

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 e30e6016a3 Fix regression following fix for 69967
e30e6016a3 is described below

commit e30e6016a38813c8e8c51c673a68bc99a1294f30
Author: remm <re...@apache.org>
AuthorDate: Mon Apr 13 15:05:43 2026 +0200

    Fix regression following fix for 69967
    
    The two special headers get added during commit.
    BZ70000
---
 java/org/apache/catalina/connector/Response.java | 12 +++++++-----
 webapps/docs/changelog.xml                       |  4 ++++
 2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/java/org/apache/catalina/connector/Response.java b/java/org/apache/catalina/connector/Response.java
index 55aa8b826d..169caf9b6e 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -776,11 +776,13 @@ public class Response implements HttpServletResponse {
         for (int i = 0; i < n; i++) {
             result.add(headers.getName(i).toString());
         }
-        if (getCoyoteResponse().getContentType() != null) {
-            result.add("Content-Type");
-        }
-        if (getCoyoteResponse().getContentLengthLong() != -1) {
-            result.add("Content-Length");
+        if (!getCoyoteResponse().isCommitted()) {
+            if (getCoyoteResponse().getContentType() != null) {
+                result.add("Content-Type");
+            }
+            if (getCoyoteResponse().getContentLengthLong() != -1) {
+                result.add("Content-Length");
+            }
         }
         return result;
     }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 71d5abca10..d7fe3d0fed 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -203,6 +203,10 @@
         Align the escaping in <code>ExtendedAccessLogValve</code> with the other
         <code>AccessLogValve</code> implementations. (markt)
       </fix>
+      <fix>
+        <bug>70000</bug>: fix duplication of special headers in the response
+        after commit, following fix for <bug>69967</bug>. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Coyote">


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org