cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1381393 - /cxf/branches/2.5.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java
Date Wed, 05 Sep 2012 21:26:13 GMT
Author: dkulp
Date: Wed Sep  5 21:26:13 2012
New Revision: 1381393

URL: http://svn.apache.org/viewvc?rev=1381393&view=rev
Log:
Merged revisions 1381383 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/branches/2.6.x-fixes

........
  r1381383 | dkulp | 2012-09-05 17:20:12 -0400 (Wed, 05 Sep 2012) | 10 lines

  Merged revisions 1380787 via  git cherry-pick from
  https://svn.apache.org/repos/asf/cxf/trunk

  ........
    r1380787 | dkulp | 2012-09-04 14:23:53 -0400 (Tue, 04 Sep 2012) | 2 lines

    The 401 push back is also echoing back headers like "Content-Length", but not sending
any content.

  ........

........

Modified:
    cxf/branches/2.5.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java

Modified: cxf/branches/2.5.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java?rev=1381393&r1=1381392&r2=1381393&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java
(original)
+++ cxf/branches/2.5.x-fixes/systests/transports/src/test/java/org/apache/cxf/systest/http/PushBack401.java
Wed Sep  5 21:26:13 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