LP1198983 disable multipart/mixed for Firefox
authorBill Erickson <berick@esilibrary.com>
Thu, 11 Jul 2013 20:36:43 +0000 (16:36 -0400)
committerDan Scott <dscott@laurentian.ca>
Thu, 11 Jul 2013 20:54:53 +0000 (16:54 -0400)
Only allow multipart mixed/replace message within the Evergreen staff
client for now.  Eventually, multi-part messages will be wholly
deprecated.

Signed-off-by: Bill Erickson <berick@esilibrary.com>
Signed-off-by: Dan Scott <dscott@laurentian.ca>
src/javascript/opensrf_xhr.js

index ccc3ffd..382ad3b 100644 (file)
@@ -48,9 +48,11 @@ OpenSRF.XHRequest.prototype.send = function() {
 
     } else {
 
-    /* Only Firefox supports multipart calls, but Safari / Chrome include
-           "Mozilla" in their user agent strings... sigh */
-        if(!navigator.userAgent.match(/mozilla/i) || navigator.userAgent.match(/webkit/i) || navigator.userAgent.match(/msie/i)) {
+        /**
+         * multi-part messages are deprecated.  Eventually this will go away.
+         * For now, continue allowing the Evergreen staff client to use
+         * multi-part messages. */
+        if (!navigator.userAgent.match(/open_ils_staff_client/)) {
             /* standard asynchronous call */
             xreq.onreadystatechange = function() {
                 if(xreq.readyState == 4)