Author: dkulp
Date: Thu Dec  3 22:05:20 2009
New Revision: 886943

URL: http://svn.apache.org/viewvc?rev=886943&view=rev
Log:
Merged revisions 885055 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r885055 | bimargulies | 2009-11-27 19:36:57 -0500 (Fri, 27 Nov 2009) | 1 line
  
  protect against clever people who add extra properties to all arrays in 
Javascript.
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    
cxf/branches/2.2.x-fixes/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: 
cxf/branches/2.2.x-fixes/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
URL: 
http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js?rev=886943&r1=886942&r2=886943&view=diff
==============================================================================
--- 
cxf/branches/2.2.x-fixes/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
 (original)
+++ 
cxf/branches/2.2.x-fixes/rt/javascript/src/main/resources/org/apache/cxf/javascript/cxf-utils.js
 Thu Dec  3 22:05:20 2009
@@ -715,11 +715,14 @@
                this.req.setRequestHeader("Content-Type", 
"text/xml;charset=utf-8");
        }
 
-       if (headers) { // must be array indexed by header field.
-               for (var h in headers) {
-                       this.req.setRequestHeader(h, headers[h]);
-               }
-       }
+    if (headers) { // must be array indexed by header field.
+        // avoid extra properties on the headers.
+        for (var h in headers) {
+            if(headers.hasOwnProperty(h)) {
+                this.req.setRequestHeader(h, headers[h]);
+            }
+        }
+    }  
 
        this.req.setRequestHeader("SOAPAction", this.soapAction);
        this.req.setRequestHeader("MessageType", this.messageType);


Reply via email to