cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r1458649 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
Date Wed, 20 Mar 2013 06:25:04 GMT
Author: ningjiang
Date: Wed Mar 20 06:25:04 2013
New Revision: 1458649

URL: http://svn.apache.org/r1458649
Log:
CXF-4906 fix the adding to User-Agent header issue

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

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java?rev=1458649&r1=1458648&r2=1458649&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/Headers.java
Wed Mar 20 06:25:04 2013
@@ -320,7 +320,8 @@ public class Headers {
                 connection.setRequestProperty(header, b.toString());
             }
         }
-        if (!connection.getRequestProperties().containsKey("User-Agent")) {
+        // make sure we don't add more than one User-Agent header
+        if (connection.getRequestProperty("User-Agent") != null) {
             connection.addRequestProperty("User-Agent", Version.getCompleteVersionString());
         }
     }



Mime
View raw message