cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6475] Adding 'http.autoredirect' property to make it simpler to configure 2.0 clients
Date Fri, 26 Jun 2015 09:31:27 GMT
Repository: cxf
Updated Branches:
  refs/heads/master da53162f3 -> 6a988318d


[CXF-6475] Adding 'http.autoredirect' property to make it simpler to configure 2.0 clients


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/6a988318
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/6a988318
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/6a988318

Branch: refs/heads/master
Commit: 6a988318d581456d6e148bf89367de8fc3a05cd0
Parents: da53162
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Jun 26 10:30:39 2015 +0100
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Jun 26 10:30:39 2015 +0100

----------------------------------------------------------------------
 .../main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java | 6 ++++++
 1 file changed, 6 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/6a988318/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
----------------------------------------------------------------------
diff --git a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
index f19a32f..fa68058 100644
--- a/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
+++ b/rt/rs/client/src/main/java/org/apache/cxf/jaxrs/client/spec/ClientImpl.java
@@ -39,6 +39,7 @@ import javax.ws.rs.core.Link;
 import javax.ws.rs.core.MediaType;
 import javax.ws.rs.core.UriBuilder;
 
+import org.apache.cxf.common.util.PropertyUtils;
 import org.apache.cxf.configuration.jsse.TLSClientParameters;
 import org.apache.cxf.jaxrs.client.ClientConfiguration;
 import org.apache.cxf.jaxrs.client.ClientProviderFactory;
@@ -52,6 +53,7 @@ public class ClientImpl implements Client {
     private static final String HTTP_RECEIVE_TIMEOUT_PROP = "http.receive.timeout";
     private static final String HTTP_PROXY_SERVER_PROP = "http.proxy.server.uri";
     private static final String HTTP_PROXY_SERVER_PORT_PROP = "http.proxy.server.port";
+    private static final String HTTP_AUTOREDIRECT_PROP = "http.autoredirect";
     
     private Configurable<Client> configImpl;
     private TLSConfiguration secConfig;
@@ -296,6 +298,10 @@ public class ClientImpl implements Client {
             if (proxyServerPortValue != null) {
                 clientCfg.getHttpConduit().getClient().setProxyServerPort(proxyServerPortValue);
             }
+            Object autoRedirectValue = configProps.get(HTTP_AUTOREDIRECT_PROP);
+            if (PropertyUtils.isTrue(autoRedirectValue)) {
+                clientCfg.getHttpConduit().getClient().setAutoRedirect(true);
+            }
         }
 
         private void initTargetClientIfNeeded() {


Mime
View raw message