From 00a00db127960cadf38967240d777d92333da17f Mon Sep 17 00:00:00 2001 From: Peter Robins Date: Tue, 7 Feb 2012 11:57:29 +0000 Subject: [PATCH] ReadWithPOST should pass through options.headers --- lib/OpenLayers/Protocol/HTTP.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/OpenLayers/Protocol/HTTP.js b/lib/OpenLayers/Protocol/HTTP.js index edcb3ed6fa..ebfacac705 100644 --- a/lib/OpenLayers/Protocol/HTTP.js +++ b/lib/OpenLayers/Protocol/HTTP.js @@ -166,7 +166,7 @@ OpenLayers.Protocol.HTTP = OpenLayers.Class(OpenLayers.Protocol, { * {} A response object, whose "priv" property * references the HTTP request, this object is also passed to the * callback function when the request completes, its "features" property - * is then populated with the the features received from the server. + * is then populated with the features received from the server. */ read: function(options) { OpenLayers.Protocol.prototype.read.apply(this, arguments); @@ -183,13 +183,13 @@ OpenLayers.Protocol.HTTP = OpenLayers.Class(OpenLayers.Protocol, { options.readWithPOST : this.readWithPOST; var resp = new OpenLayers.Protocol.Response({requestType: "read"}); if(readWithPOST) { + var headers = options.headers || {}; + headers["Content-Type"] = "application/x-www-form-urlencoded"; resp.priv = OpenLayers.Request.POST({ url: options.url, callback: this.createCallback(this.handleRead, resp, options), data: OpenLayers.Util.getParameterString(options.params), - headers: { - "Content-Type": "application/x-www-form-urlencoded" - } + headers: headers }); } else { resp.priv = OpenLayers.Request.GET({