This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 92a94e78d2 Fix regression following fix for 69967
92a94e78d2 is described below
commit 92a94e78d2e64749f534942d77cd5a5c3f08d6a2
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 05193bcf5a..a4e8e92b6d 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -778,11 +778,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 bc6f51e1af..3f4c2bd298 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]