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:32:39 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes e16cd8f6e -> d54ca8cb1


[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/d54ca8cb
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/d54ca8cb
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/d54ca8cb

Branch: refs/heads/3.0.x-fixes
Commit: d54ca8cb1c7f3aa6bdbe9ba47b39080f6d2fb1b3
Parents: e16cd8f
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:32:19 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/d54ca8cb/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