cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1040635 - /cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Date Tue, 30 Nov 2010 16:45:35 GMT
Author: dkulp
Date: Tue Nov 30 16:45:34 2010
New Revision: 1040635

URL: http://svn.apache.org/viewvc?rev=1040635&view=rev
Log:
[CXF-3100] Add cookies on retransmit

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

Modified: cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1040635&r1=1040634&r2=1040635&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/trunk/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Tue Nov 30 16:45:34 2010
@@ -1104,6 +1104,10 @@ public class HTTPConduit 
         }
 
         new Headers(message).setAuthorization(up);
+        
+        // also adding cookie headers when retransmitting in case of a "401 Unauthorized"
response
+        cookies.writeToMessageHeaders(message);
+        
         return retransmit(
                 connection, currentURL, message, cachedStream);
     }
@@ -1156,6 +1160,7 @@ public class HTTPConduit 
         // Disconnect the old, and in with the new.
         connection.disconnect();
         
+        
         HTTPClientPolicy cp = getClient(message);
         connection = createConnection(message, newURL);
         connection.setDoOutput(true);        
@@ -1503,6 +1508,8 @@ public class HTTPConduit 
                                      ? -1
                                      : policy.getMaxRetransmits();
                 
+                cookies.readFromConnection(oldcon);
+                
                 // MaxRetransmits of zero means zero.
                 if (maxRetransmits == 0) {
                     return;



Mime
View raw message