cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From egl...@apache.org
Subject svn commit: r530701 - /incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Date Fri, 20 Apr 2007 08:58:18 GMT
Author: eglynn
Date: Fri Apr 20 01:58:17 2007
New Revision: 530701

URL: http://svn.apache.org/viewvc?view=rev&rev=530701
Log:
Restore inadvertantly removed append of encoding to content-type header in HTTPConduit, on
beahalf of Polar.

Modified:
    incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java

Modified: incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?view=diff&rev=530701&r1=530700&r2=530701
==============================================================================
--- incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ incubator/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Fri Apr 20 01:58:17 2007
@@ -759,10 +759,18 @@
         HttpURLConnection connection = 
             (HttpURLConnection)message.get(KEY_HTTP_CONNECTION);
 
-        String ct = (String) message.get(Message.CONTENT_TYPE);
+        String ct  = (String) message.get(Message.CONTENT_TYPE);
+        String enc = (String) message.get(Message.ENCODING);
+        
         if (null != ct) {
+            if (enc != null && ct.indexOf("charset=") == -1) {
+                ct = ct + "; charset=" + enc;
+            }
             connection.setRequestProperty(
                     HttpHeaderHelper.CONTENT_TYPE, ct);
+        } else if (enc != null) {
+            connection.setRequestProperty(
+                    HttpHeaderHelper.CONTENT_TYPE, "text/xml; charset=" + enc);
         } else {
             connection.setRequestProperty(
                     HttpHeaderHelper.CONTENT_TYPE, "text/xml");



Mime
View raw message