I just committed the fix for said PR. A test for this was also added to mauve.

2006-09-20  David Daney  <[EMAIL PROTECTED]>

        PR classpath/28661
        * gnu/java/net/protocol/http/HTTPURLConnection.java (connect):  Add
        default content-type for POST method.
Index: gnu/java/net/protocol/http/HTTPURLConnection.java
===================================================================
RCS file: 
/sources/classpath/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java,v
retrieving revision 1.26
diff -u -p -r1.26 HTTPURLConnection.java
--- gnu/java/net/protocol/http/HTTPURLConnection.java   12 May 2006 20:59:30 
-0000      1.26
+++ gnu/java/net/protocol/http/HTTPURLConnection.java   12 Aug 2006 00:56:45 
-0000
@@ -149,6 +149,14 @@ public class HTTPURLConnection
     final Credentials creds = (username == null) ? null :
       new Credentials (username, password);
     
+    if ("POST".equals(method))
+      {
+        String contentType = requestHeaders.getValue("Content-Type");
+        if (null == contentType)
+          requestHeaders.addValue("Content-Type",
+                                  "application/x-www-form-urlencoded");
+      }
+
     boolean retry;
     do
       {

Reply via email to