From: erickson Date: Mon, 24 Mar 2008 17:55:08 +0000 (+0000) Subject: added ontransporthander support for multipart requests X-Git-Tag: osrf_rel_2_0_1~676 X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=06ca07b5492f0d81b5506c537a24079ed1e4a8c0;p=OpenSRF.git added ontransporthander support for multipart requests git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@1291 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/javascript/opensrf_xhr.js b/src/javascript/opensrf_xhr.js index 81d7e3d..8c79441 100644 --- a/src/javascript/opensrf_xhr.js +++ b/src/javascript/opensrf_xhr.js @@ -56,6 +56,13 @@ OpenSRF.XHRequest.prototype.send = function() { xreq.onload = function(evt) {xhr_req.core_handler();} xreq.open('POST', OSRF_HTTP_TRANSLATOR, true); xreq.setRequestHeader(OSRF_HTTP_HEADER_MULTIPART, 'true'); + + /* multipart requests do not pass the status info to the onload if there + is no new data to load. Capture the status on the readystate handler */ + xreq.onreadystatechange = function() { + if(xreq.readyState == 4 && xreq.status >= 400) + xhr_req.transport_error_handler(); + } } }