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

commit cdb2e045d20a6b11bdb256edd2d5d164efd09c77
Author: remm <[email protected]>
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 3331382774..1f2de87294 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -797,11 +797,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 7745279198..7693aa4f31 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -124,6 +124,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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to