The patch for this is attached. Could somebody please apply?
Thanks,
-Polar

Polar Humenn wrote:
Jarek Gawor wrote:
Any particular reason why this was removed from HTTPConduit.java when
path for CXF-438 was applied?

- 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");
        }

Jarek
Hi Jarek,

In the copy in which I applied the middle segment starting with "else if (enc != null)" segment wasn't there. Maybe it looks like that snuck in between the time I was creating patches and when it got applied.

It's easy enough to fix.

Cheers,
-Polar


Index: 
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
===================================================================
--- 
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java 
    (revision 530526)
+++ 
rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java 
    (working copy)
@@ -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");

Reply via email to