cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1384441 - /cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/CXFAsyncRequester.java
Date Thu, 13 Sep 2012 18:01:14 GMT
Author: dkulp
Date: Thu Sep 13 18:01:13 2012
New Revision: 1384441

URL: http://svn.apache.org/viewvc?rev=1384441&view=rev
Log:
CXF handles the redirect itself based on the policies in the client policy

Modified:
    cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/CXFAsyncRequester.java

Modified: cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/CXFAsyncRequester.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/CXFAsyncRequester.java?rev=1384441&r1=1384440&r2=1384441&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/CXFAsyncRequester.java
(original)
+++ cxf/trunk/rt/transports/http-hc/src/main/java/org/apache/cxf/transport/http/asyncclient/CXFAsyncRequester.java
Thu Sep 13 18:01:13 2012
@@ -28,7 +28,12 @@ import javax.net.ssl.SSLEngine;
 import javax.net.ssl.SSLException;
 import javax.net.ssl.SSLSession;
 
+import org.apache.http.HttpRequest;
+import org.apache.http.HttpResponse;
 import org.apache.http.HttpVersion;
+import org.apache.http.ProtocolException;
+import org.apache.http.client.RedirectStrategy;
+import org.apache.http.client.methods.HttpUriRequest;
 import org.apache.http.client.protocol.ClientContext;
 import org.apache.http.concurrent.BasicFuture;
 import org.apache.http.concurrent.FutureCallback;
@@ -113,6 +118,17 @@ public class CXFAsyncRequester {
             }
         };
         context.setAttribute(ClientContext.SCHEME_REGISTRY, reg);
+        //CXF handles redirects ourselves
+        dhac.setRedirectStrategy(new RedirectStrategy() {
+            public boolean isRedirected(HttpRequest request, HttpResponse response, HttpContext
context)
+                throws ProtocolException {
+                return false;
+            }
+            public HttpUriRequest getRedirect(HttpRequest request, HttpResponse response,
HttpContext context)
+                throws ProtocolException {
+                return null;
+            }
+        });
         dhac.execute(requestProducer, responseConsumer, context, callback);
 
         return future;



Mime
View raw message