Index: libraries/javalib/java/net/HttpURLConnection.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/net/HttpURLConnection.java,v
retrieving revision 1.5
diff -u -r1.5 HttpURLConnection.java
--- libraries/javalib/java/net/HttpURLConnection.java	19 Feb 2002 00:48:12 -0000	1.5
+++ libraries/javalib/java/net/HttpURLConnection.java	16 Jul 2003 15:19:02 -0000
@@ -61,6 +61,10 @@
 
 protected HttpURLConnection(URL url) {
 	super(url);
+    
+    // Sun seems to has some default HttpHeaders
+    setRequestProperty( "Accept", "text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2" );
+    setRequestProperty( "User-Agent", System.getProperty("java.vm.name")+"/"+System.getProperty("java.vm.version") );
 }
 
 public static boolean getFollowRedirects () {

Index: libraries/javalib/java/net/URLConnection.java
===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/java/net/URLConnection.java,v
retrieving revision 1.11
diff -u -r1.11 URLConnection.java
--- libraries/javalib/java/net/URLConnection.java	31 May 2003 06:01:16 -0000	1.11
+++ libraries/javalib/java/net/URLConnection.java	16 Jul 2003 15:19:21 -0000
@@ -16,6 +16,7 @@
 import java.text.DateFormat;
 import java.text.ParseException;
 import java.util.Date;
+import java.util.Vector;
 import java.security.Permission;
 import java.security.AllPermission;
 import kaffe.net.DefaultFileNameMap;
@@ -35,9 +36,10 @@
 	protected long ifModifiedSince;
 	protected URL url;
 	protected boolean useCaches = defaultUseCaches;
+    protected Vector requestProperties = new Vector();
 	private static ContentHandlerFactory factory;
 	private static boolean defaultAllowUserInteraction;
-	private static boolean defaultUseCaches;
+	private static boolean defaultUseCaches;    
 
 protected URLConnection (URL url) {
 	this.url = url;
@@ -230,6 +232,19 @@
 }
 
 public void setRequestProperty(String key, String value) {
+    if ( key == null )
+        throw new NullPointerException("key is null");
+
+    // In the api sun says, that http schould append recurrend headers
+    // but jdk 1.4.1 does not. So we replace here.
+    int pos = requestProperties.indexOf( key );
+    if (pos > -1) {
+        requestProperties.removeElementAt( pos+1 );
+        requestProperties.removeElementAt( pos );
+    }         
+
+    requestProperties.add( key );
+    requestProperties.add( value );
 }
 
 public void setUseCaches(boolean usecaches) {


===================================================================
RCS file: /cvs/kaffe/kaffe/libraries/javalib/kaffe/net/www/protocol/http/HttpURLConnection.java,v
retrieving revision 1.14
diff -u -r1.14 HttpURLConnection.java
--- libraries/javalib/kaffe/net/www/protocol/http/HttpURLConnection.java	11 May 2003 16:26:24 -0000	1.14
+++ libraries/javalib/kaffe/net/www/protocol/http/HttpURLConnection.java	16 Jul 2003 15:19:37 -0000
@@ -21,6 +21,7 @@
 import java.io.FileInputStream;
 import java.io.FileOutputStream;
 import java.util.Vector;
+import java.util.Iterator;
 import java.net.URL;
 import java.net.Socket;
 import java.awt.Toolkit;
@@ -137,7 +138,27 @@
 			long l = (tmpFile != null ? tmpFile.length() : 0L);
 			out.writeBytes("Content-Length: " + l + "\r\n");
 		}
-		// TODO: emit all RequestHeaders see setRequestProperty
+
+		// emit all RequestHeaders
+        for (Iterator iter = requestProperties.iterator(); iter.hasNext();) {
+            String key = (String)iter.next();
+            String val = (String)iter.next();
+			out.writeBytes(key);
+            if (val != null) 
+                out.writeBytes( ": " + val );
+			out.writeBytes("\r\n");
+        }
+
+        
+        if (! useCaches) {
+            if ( ! requestProperties.contains("Cache-Control") ) 
+                out.writeBytes("Cache-Control: no-cache\r\n");
+            if ( ! requestProperties.contains("Pragma") ) 
+                out.writeBytes("Pragma: no-cache\r\n");
+        }
+             
+        
+
 		// header end
 		out.writeBytes("\r\n");
 		if(doOutput) {
