Skip to content

Commit 1c4a89a

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

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
@@ -820,11 +820,13 @@ public Collection<String> getHeaderNames() {
820820
for (int i = 0; i < n; i++) {
821821
result.add(headers.getName(i).toString());
822822
}
823-
if (getCoyoteResponse().getContentType() != null) {
824-
result.add("Content-Type");
825-
}
826-
if (getCoyoteResponse().getContentLengthLong() != -1) {
827-
result.add("Content-Length");
823+
if (!getCoyoteResponse().isCommitted()) {
824+
if (getCoyoteResponse().getContentType() != null) {
825+
result.add("Content-Type");
826+
}
827+
if (getCoyoteResponse().getContentLengthLong() != -1) {
828+
result.add("Content-Length");
829+
}
828830
}
829831
return result;
830832
}

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)