[OpenLayers-Commits] r11880 - in trunk/openlayers: lib/OpenLayers/Protocol/WFS tests/Protocol

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Apr 6 02:59:09 EDT 2011


Author: fredj
Date: 2011-04-05 23:59:05 -0700 (Tue, 05 Apr 2011)
New Revision: 11880

Modified:
   trunk/openlayers/lib/OpenLayers/Protocol/WFS/v1.js
   trunk/openlayers/tests/Protocol/WFS.html
Log:
WFS protocol commit: send HTTP headers. p=arneke,me r=me (closes #3204)

Modified: trunk/openlayers/lib/OpenLayers/Protocol/WFS/v1.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Protocol/WFS/v1.js	2011-04-05 19:27:52 UTC (rev 11879)
+++ trunk/openlayers/lib/OpenLayers/Protocol/WFS/v1.js	2011-04-06 06:59:05 UTC (rev 11880)
@@ -203,7 +203,7 @@
             params: options.params,
             headers: options.headers,
             data: data
-        });        
+        });
 
         return response;
     },
@@ -316,6 +316,7 @@
         });
         response.priv = OpenLayers.Request.POST({
             url: options.url,
+            headers: options.headers,
             data: this.format.write(features, options),
             callback: this.createCallback(this.handleCommit, response, options)
         });

Modified: trunk/openlayers/tests/Protocol/WFS.html
===================================================================
--- trunk/openlayers/tests/Protocol/WFS.html	2011-04-05 19:27:52 UTC (rev 11879)
+++ trunk/openlayers/tests/Protocol/WFS.html	2011-04-06 06:59:05 UTC (rev 11880)
@@ -106,7 +106,7 @@
     }
 
     function test_commit(t){
-        t.plan(4);
+        t.plan(5);
 
         var url = "http://some.url.org";
         var protocol = new OpenLayers.Protocol.WFS({
@@ -127,6 +127,7 @@
         var expected;
         OpenLayers.Request.POST = function(obj) {
             t.xml_eq(new OpenLayers.Format.XML().read(obj.data).documentElement, expected, "Transaction XML with Insert, Update and Delete created correctly");
+            t.eq(obj.headers, {foo: 'bar'}, "HTTP headers passed from commit to Request.POST");
             obj.responseText = "foo";
             t.delay_call(0.1, function() {obj.callback.call(this)});
             return obj;
@@ -151,6 +152,7 @@
         options = {
             featureNS: "http://some.namespace.org",
             featureType: "type",
+            headers: {foo: 'bar'},
             callback: function(response) {
                 t.eq(response.insertIds.length, 3, "correct response passed to user callback");
                 t.eq(response.code, OpenLayers.Protocol.Response.SUCCESS, "success properly reported to user callback");



More information about the Commits mailing list