As per the PR, HTTPURLConnection.getRequestProperties() was returning a
Map with Strings as values instead a Map of Lists of Strings as values.
I just committed this patch:
2006-02-27 David Daney <[EMAIL PROTECTED]>
PR classpath/25851
* gnu/java/net/protocol/http/HTTPURLConnection.java (imports) Cleaned
up.
(getRequestProperties): Rewrote.
? cis.changelog
? d
? tools/tools.zip
Index: gnu/java/net/protocol/http/HTTPURLConnection.java
===================================================================
RCS file:
/sources/classpath/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java,v
retrieving revision 1.21
diff -u -p -r1.21 HTTPURLConnection.java
--- gnu/java/net/protocol/http/HTTPURLConnection.java 27 Feb 2006 18:48:57
-0000 1.21
+++ gnu/java/net/protocol/http/HTTPURLConnection.java 27 Feb 2006 23:32:50
-0000
@@ -48,8 +48,10 @@ import java.io.OutputStream;
import java.net.ProtocolException;
import java.net.URL;
import java.security.cert.Certificate;
+import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
+import java.util.HashMap;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
@@ -420,7 +422,21 @@ public class HTTPURLConnection
if (connected)
throw new IllegalStateException("Already connected");
- return requestHeaders;
+ HashMap m = new HashMap(requestHeaders);
+ Iterator it = m.entrySet().iterator();
+ while (it.hasNext())
+ {
+ Map.Entry e = (Map.Entry)it.next();
+ String s = (String)e.getValue();
+ String sa[] = s.split(",");
+ ArrayList l = new ArrayList(sa.length);
+ for (int i = 0; i < sa.length; i++)
+ {
+ l.add(sa[i].trim());
+ }
+ e.setValue(Collections.unmodifiableList(l));
+ }
+ return Collections.unmodifiableMap(m);
}
public void setRequestProperty(String key, String value)