@fabriktor/client 0.0.104 → 0.0.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -208,11 +208,11 @@ function uploadForm(opts) {
208
208
  return form;
209
209
  }
210
210
  function appendFile(form, f) {
211
- if (isFile(f)) {
212
- form.append(fileFieldName, f, f.name);
213
- return;
214
- }
215
- form.append(fileFieldName, f.blob, f.filename);
211
+ const { blob, filename } = isFile(f) ? { blob: f, filename: f.name } : f;
212
+ // WebKit can send an empty multipart body for Files restored from IndexedDB.
213
+ // A Blob slice avoids that file-path branch without buffering the whole file.
214
+ // https://bugs.webkit.org/show_bug.cgi?id=319985
215
+ form.append(fileFieldName, blob.slice(0, blob.size, blob.type), filename);
216
216
  }
217
217
  function isFile(f) {
218
218
  return typeof File !== "undefined" && f instanceof File;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabriktor/client",
3
- "version": "0.0.104",
3
+ "version": "0.0.106",
4
4
  "description": "![Fabriktor Logo](./img/fabriktor-character.gif)",
5
5
  "type": "module",
6
6
  "exports": {