Skip to content

Commit cdb2e04

Browse files
committed
Fix regression following fix for 69967
The two special headers get added during commit. BZ70000
1 parent b8fc01d commit cdb2e04

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

java/org/apache/catalina/connector/Response.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -797,11 +797,13 @@ public Collection<String> getHeaderNames() {
797797
for (int i = 0; i < n; i++) {
798798
result.add(headers.getName(i).toString());
799799
}
800-
if (getCoyoteResponse().getContentType() != null) {
801-
result.add("Content-Type");
802-
}
803-
if (getCoyoteResponse().getContentLengthLong() != -1) {
804-
result.add("Content-Length");
800+
if (!getCoyoteResponse().isCommitted()) {
801+
if (getCoyoteResponse().getContentType() != null) {
802+
result.add("Content-Type");
803+
}
804+
if (getCoyoteResponse().getContentLengthLong() != -1) {
805+
result.add("Content-Length");
806+
}
805807
}
806808
return result;
807809
}

webapps/docs/changelog.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@
124124
Align the escaping in <code>ExtendedAccessLogValve</code> with the other
125125
<code>AccessLogValve</code> implementations. (markt)
126126
</fix>
127+
<fix>
128+
<bug>70000</bug>: fix duplication of special headers in the response
129+
after commit, following fix for <bug>69967</bug>. (remm)
130+
</fix>
127131
</changelog>
128132
</subsection>
129133
<subsection name="Coyote">

0 commit comments

Comments
 (0)