[OpenLayers-Trac] [OpenLayers] #3604: oRequest is not defined posting XML

OpenLayers trac-20090302 at openlayers.org
Tue Jan 10 07:34:17 EST 2012


#3604: oRequest is not defined posting XML
-------------------------------------+--------------------------------------
 Reporter:  kikearake                |       Owner:              
     Type:  bug                      |      Status:  new         
 Priority:  minor                    |   Milestone:  2.12 Release
Component:  general                  |     Version:  2.11        
 Keywords:  oRequest is not defined  |       State:              
-------------------------------------+--------------------------------------
 When i use the OpenLayers.Request.POST with xml document, i recieve
 "oRequest is not definded".

 Browsing the code i see:

 {{{
     cXMLHttpRequest.prototype.send    = function(vData) {
         // Add method sniffer
         if (cXMLHttpRequest.onsend)
             cXMLHttpRequest.onsend.apply(this, arguments);

         if (!arguments.length)
             vData    = null;

         // BUGFIX: Safari - fails sending documents created/modified
 dynamically, so an explicit serialization required
         // BUGFIX: IE - rewrites any custom mime-type to "text/xml" in
 case an XMLNode is sent
         // BUGFIX: Gecko - fails sending Element (this is up to the
 implementation either to standard)
         if (vData && vData.nodeType) {
             vData    = window.XMLSerializer ? new
 window.XMLSerializer().serializeToString(vData) : vData.xml;
             if (!oRequest._headers["Content-Type"])
                 oRequest._object.setRequestHeader("Content-Type",
 "application/xml");
         }

         this._data    = vData;
 /*
         // Add to queue
         if (this._async)
             fQueue_add(this);
         else*/
             fXMLHttpRequest_send(this);
     };

 }}}

 in XMLHttpRequest.js

 If i change "oRequest" with "this" in this lines

 {{{
  if (!oRequest._headers["Content-Type"])
                 oRequest._object.setRequestHeader("Content-Type",
 "application/xml");
         }
 }}}

 it works(no error).


 It's a bug? or i'm missing something?

-- 
Ticket URL: <http://trac.openlayers.org/ticket/3604>
OpenLayers <http://openlayers.org/>
A free AJAX map viewer


More information about the Trac mailing list