jpillora / xdomain

A pure JavaScript CORS alternative
https://jpillora.com/xdomain/
3.12k stars 270 forks source link

How can i send file to server #219

Closed NoskovEugene closed 6 days ago

NoskovEugene commented 4 years ago

Hi there! I use Xdomain in my project (dotnet & react) and i want to send file to server. Xdomain report about error. How can i send file to server? Screenshot_1

NoskovEugene commented 4 years ago

Hi, i finded bug in your project.

Array.from(entries).forEach(function (arg) {
        if (args[0] === "XD_BLOB" && args.length === 4) {
          var blob = new Blob([args[2]], { type: args[3] });
          args = args[1];
          args[1] = blob;
        }
        fd.append.apply(fd, args);
      });

please change Array.from(entries).forEach(function (arg) to Array.from(entries).forEach(function (args) I think it in "slave.js". Please check it out.