diff options
author | David Daney <ddaney@avtrex.com> | 2006-09-22 18:45:14 +0000 |
---|---|---|
committer | David Daney <daney@gcc.gnu.org> | 2006-09-22 18:45:14 +0000 |
commit | 17bdf398eb950172c8ba5f5d8b6e0bb9fc6b6bb7 (patch) | |
tree | 66eb7bbb3246c7796c8f6c8b330fb229f8ae91ae /libjava | |
parent | 3b83e64bd3b0c9b9c69fc94276f88171e1376772 (diff) | |
download | gcc-17bdf398eb950172c8ba5f5d8b6e0bb9fc6b6bb7.zip gcc-17bdf398eb950172c8ba5f5d8b6e0bb9fc6b6bb7.tar.gz gcc-17bdf398eb950172c8ba5f5d8b6e0bb9fc6b6bb7.tar.bz2 |
re PR classpath/28661 (HTTP Header differs b/w java and classpath)
PR classpath/28661
* gnu/java/net/protocol/http/HTTPURLConnection.java (connect): Add
default content-type for POST method.
From-SVN: r117149
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/classpath/ChangeLog.gcj | 6 | ||||
-rw-r--r-- | libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java | 8 |
2 files changed, 14 insertions, 0 deletions
diff --git a/libjava/classpath/ChangeLog.gcj b/libjava/classpath/ChangeLog.gcj index 19ce949..98b35cf 100644 --- a/libjava/classpath/ChangeLog.gcj +++ b/libjava/classpath/ChangeLog.gcj @@ -1,3 +1,9 @@ +2006-09-22 David Daney <ddaney@avtrex.com> + + PR classpath/28661 + * gnu/java/net/protocol/http/HTTPURLConnection.java (connect): Add + default content-type for POST method. + 2006-09-20 Gary Benson <gbenson@redhat.com> * java/net/InetAddress.java: Updated to latest. diff --git a/libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java b/libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java index a46d120..cc68a3b 100644 --- a/libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java +++ b/libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java @@ -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 { |