Author: remm
Date: Thu Oct 30 08:37:01 2014
New Revision: 1635429
URL: http://svn.apache.org/r1635429
Log:
Fileupload respects header ordering, but the part implementation doesn't. Also
use a linked collection there to fix the discrepancy.
Modified:
tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java
tomcat/trunk/webapps/docs/changelog.xml
Modified: tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java?rev=1635429&r1=1635428&r2=1635429&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java (original)
+++ tomcat/trunk/java/org/apache/catalina/core/ApplicationPart.java Thu Oct 30
08:37:01 2014
@@ -22,8 +22,8 @@ import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.Collection;
import java.util.Collections;
-import java.util.HashSet;
import java.util.Iterator;
+import java.util.LinkedHashSet;
import java.util.Locale;
import java.util.Map;
@@ -69,7 +69,7 @@ public class ApplicationPart implements
@Override
public Collection<String> getHeaderNames() {
if (fileItem instanceof DiskFileItem) {
- HashSet<String> headerNames = new HashSet<>();
+ LinkedHashSet<String> headerNames = new LinkedHashSet<>();
Iterator<String> iter =
((DiskFileItem) fileItem).getHeaders().getHeaderNames();
while (iter.hasNext()) {
@@ -83,7 +83,7 @@ public class ApplicationPart implements
@Override
public Collection<String> getHeaders(String name) {
if (fileItem instanceof DiskFileItem) {
- HashSet<String> headers = new HashSet<>();
+ LinkedHashSet<String> headers = new LinkedHashSet<>();
Iterator<String> iter =
((DiskFileItem) fileItem).getHeaders().getHeaders(name);
while (iter.hasNext()) {
Modified: tomcat/trunk/webapps/docs/changelog.xml
URL:
http://svn.apache.org/viewvc/tomcat/trunk/webapps/docs/changelog.xml?rev=1635429&r1=1635428&r2=1635429&view=diff
==============================================================================
--- tomcat/trunk/webapps/docs/changelog.xml (original)
+++ tomcat/trunk/webapps/docs/changelog.xml Thu Oct 30 08:37:01 2014
@@ -195,6 +195,10 @@
have a docBase on the file system. This is primarily intended for use
when embedding. (markt)
</fix>
+ <fix>
+ Propagate header ordering from fileupload to the part implementation.
+ (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]