Преглед на файлове

Merge pull request #9 from dom111/master-topic-8-remove_send_as_binary_oplyfill

Remove sendAsBinary polyfill and call send directly.
Dom Hastings преди 6 години
родител
ревизия
9d7c0082fb
променени са 2 файла, в които са добавени 1 реда и са изтрити 18 реда
  1. BIN
      src/webdav-min.js
  2. 1 18
      src/webdav.js

BIN
src/webdav-min.js


+ 1 - 18
src/webdav.js

@@ -1,21 +1,4 @@
 (function($) {
-    /**
-     * sendAsBinary
-     *
-     * @url http://stackoverflow.com/questions/3743047/uploading-a-binary-string-in-webkit-chrome-using-xhr-equivalent-to-firefoxs-se
-     */
-    if (!('sendAsBinary' in XMLHttpRequest.prototype)) {
-        XMLHttpRequest.prototype.sendAsBinary = function(datastr) {
-            function byteValue(x) {
-                return x.charCodeAt(0) & 0xff;
-            }
-
-            var ords = Array.prototype.map.call(datastr, byteValue);
-            var ui8a = new Uint8Array(ords);
-            this.send(ui8a.buffer);
-        };
-    }
-
     if (!('from' in Array)) {
         Array.from = function(aryLike) {
             return [].slice.call(aryLike);
@@ -685,7 +668,7 @@
 
                 _updateDisplay();
 
-                file.request.sendAsBinary(file.data);
+                file.request.send(file.data);
 
                 return true;
             },