This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Patch: Backport PR classpath/28661 fix (more HTTP fixes).
- From: David Daney <ddaney at avtrex dot com>
- To: Java Patch List <java-patches at gcc dot gnu dot org>
- Date: Fri, 22 Sep 2006 10:22:18 -0700
- Subject: Patch: Backport PR classpath/28661 fix (more HTTP fixes).
I would like to back port the PR classpath/28661 to libgcj.
Tested on i686-pc-linux-gnu with no regressions.
OK to commit?
2006-09-20 David Daney <ddaney@avtrex.com>
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
===================================================================
--- gnu/java/net/protocol/http/HTTPURLConnection.java (revision 117058)
+++ gnu/java/net/protocol/http/HTTPURLConnection.java (working copy)
@@ -149,6 +149,14 @@
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
{