cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1380787 - /cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java
Date Tue, 04 Sep 2012 18:23:53 GMT
Author: dkulp
Date: Tue Sep  4 18:23:53 2012
New Revision: 1380787

URL: http://svn.apache.org/viewvc?rev=1380787&view=rev
Log:
The 401 push back is also echoing back headers like "Content-Length", but not sending any
content.

Modified:
    cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java

Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java?rev=1380787&r1=1380786&r2=1380787&view=diff
==============================================================================
--- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java
(original)
+++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java
Tue Sep  4 18:23:53 2012
@@ -36,6 +36,7 @@ import org.apache.cxf.message.MessageImp
 import org.apache.cxf.phase.AbstractPhaseInterceptor;
 import org.apache.cxf.phase.Phase;
 import org.apache.cxf.transport.Conduit;
+import org.apache.cxf.transport.http.Headers;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 
 /*
@@ -180,11 +181,12 @@ public class PushBack401 extends Abstrac
         if (outMessage == null) {
             Endpoint endpoint = exchange.get(Endpoint.class);
             outMessage = new MessageImpl();
+            outMessage.putAll(message);
+            outMessage.remove(Message.PROTOCOL_HEADERS);
             outMessage.setExchange(exchange);
             outMessage = endpoint.getBinding().createMessage(outMessage);
             exchange.setOutMessage(outMessage);
         }
-        outMessage.putAll(message);
         return outMessage;
     }
     
@@ -192,14 +194,9 @@ public class PushBack401 extends Abstrac
      * This function sets the header in the PROTOCO_HEADERS of
      * the message.
      */
-    @SuppressWarnings("unchecked")
     private void setHeader(Message message, String key, String value) {
-        Map<String, List<String>> responseHeaders =
-            (Map<String, List<String>>) 
-                message.get(Message.PROTOCOL_HEADERS);
-        if (responseHeaders != null) {
-            responseHeaders.put(key, Arrays.asList(new String[] {value}));
-        }
+        Map<String, List<String>> responseHeaders = Headers.getSetProtocolHeaders(message);
+        responseHeaders.put(key, Arrays.asList(new String[] {value}));
     }
     
     /**



Mime
View raw message