cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject cxf git commit: Fix of non thread safe map reqHeaders - SOAP_ACTION is shared between different requests - This closes #307
Date Wed, 30 Aug 2017 13:59:08 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 5ecbf0336 -> 76145af39


Fix of non thread safe map reqHeaders - SOAP_ACTION is shared between different requests -
This closes #307


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/76145af3
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/76145af3
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/76145af3

Branch: refs/heads/master
Commit: 76145af3934b56fb97b01a2b099a5fa13d56ae9c
Parents: 5ecbf03
Author: Dmitry Panov <vbnhfylbh@gmail.com>
Authored: Wed Aug 30 15:58:42 2017 +0200
Committer: Dennis Kieselhorst <deki@apache.org>
Committed: Wed Aug 30 15:58:42 2017 +0200

----------------------------------------------------------------------
 .../interceptor/SoapPreProtocolOutInterceptor.java   | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/76145af3/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
----------------------------------------------------------------------
diff --git a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
index 7c78ed7..d4be2d5 100644
--- a/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
+++ b/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
@@ -114,17 +114,16 @@ public class SoapPreProtocolOutInterceptor extends AbstractSoapInterceptor
{
         String action = getSoapAction(message, boi);
 
         if (message.getVersion() instanceof Soap11) {
+            Map<String, List<String>> tempReqHeaders = new TreeMap<String,
List<String>>(String.CASE_INSENSITIVE_ORDER);
             Map<String, List<String>> reqHeaders
-                = CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
-            if (reqHeaders == null) {
-                reqHeaders = new TreeMap<String, List<String>>(String.CASE_INSENSITIVE_ORDER);
+                    = CastUtils.cast((Map<?, ?>)message.get(Message.PROTOCOL_HEADERS));
+            if (reqHeaders != null) {
+                tempReqHeaders.putAll(reqHeaders);
             }
-
-            if (reqHeaders.size() == 0) {
-                message.put(Message.PROTOCOL_HEADERS, reqHeaders);
+            if (!tempReqHeaders.containsKey(SoapBindingConstants.SOAP_ACTION)) {
+                tempReqHeaders.put(SoapBindingConstants.SOAP_ACTION, Collections.singletonList(action));
             }
-
-            reqHeaders.put(SoapBindingConstants.SOAP_ACTION, Collections.singletonList(action));
+            message.put(Message.PROTOCOL_HEADERS, tempReqHeaders);
         } else if (message.getVersion() instanceof Soap12 && !"\"\"".equals(action))
{
             String ct = (String) message.get(Message.CONTENT_TYPE);
 


Mime
View raw message