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/classpath/gnu | |
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/classpath/gnu')
-rw-r--r-- | libjava/classpath/gnu/java/net/protocol/http/HTTPURLConnection.java | 8 |
1 files changed, 8 insertions, 0 deletions
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 { |