You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2020/02/25 19:42:39 UTC
[tomcat] branch 8.5.x updated: BZ 64166.
HttpServletResponse.getHeaderNames() now returns unique names
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new 19be442 BZ 64166. HttpServletResponse.getHeaderNames() now returns unique names
19be442 is described below
commit 19be442046f3fb4fcf18315d460a17bd433bb9f5
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Tue Feb 25 14:16:44 2020 +0000
BZ 64166. HttpServletResponse.getHeaderNames() now returns unique names
https://bz.apache.org/bugzilla/show_bug.cgi?id=64166
---
java/org/apache/catalina/connector/Response.java | 7 ++++---
webapps/docs/changelog.xml | 4 ++++
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/java/org/apache/catalina/connector/Response.java b/java/org/apache/catalina/connector/Response.java
index 47d3904..97c18a5 100644
--- a/java/org/apache/catalina/connector/Response.java
+++ b/java/org/apache/catalina/connector/Response.java
@@ -30,8 +30,10 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Enumeration;
+import java.util.LinkedHashSet;
import java.util.List;
import java.util.Locale;
+import java.util.Set;
import javax.servlet.ServletOutputStream;
import javax.servlet.ServletResponse;
@@ -882,9 +884,8 @@ public class Response implements HttpServletResponse {
@Override
public Collection<String> getHeaders(String name) {
- Enumeration<String> enumeration =
- getCoyoteResponse().getMimeHeaders().values(name);
- List<String> result = new ArrayList<>();
+ Enumeration<String> enumeration = getCoyoteResponse().getMimeHeaders().values(name);
+ Set<String> result = new LinkedHashSet<>();
while (enumeration.hasMoreElements()) {
result.add(enumeration.nextElement());
}
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 32e074f..afa42bb 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -70,6 +70,10 @@
<fix>
Missing store config attributes for Resources elements. (remm)
</fix>
+ <fix>
+ <bug>64166</bug>: Ensure that the names returned by
+ <code>HttpServletResponse.getHeaderNames()</code> are unique. (markt)
+ </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