@gigadrive/sdk 0.8.1 → 0.8.3

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.
package/dist/index.mjs CHANGED
@@ -1104,10 +1104,16 @@ var tusUploadTransport = (params) => new Promise((resolve, reject) => {
1104
1104
  cleanup();
1105
1105
  fn();
1106
1106
  };
1107
+ const headers = Object.fromEntries(
1108
+ Object.entries(params.headers).filter(([name]) => name.toLowerCase() !== "tus-resumable")
1109
+ );
1107
1110
  const upload = new tus.Upload(params.data, {
1108
1111
  uploadUrl: params.uploadUrl,
1109
1112
  uploadSize: params.uploadSize,
1110
- headers: params.headers,
1113
+ // tus-js-client sets Tus-Resumable itself. In browsers, forwarding the
1114
+ // session's copy makes XMLHttpRequest combine both values and produces
1115
+ // an invalid `1.0.0, 1.0.0` protocol header.
1116
+ headers,
1111
1117
  chunkSize: params.chunkSize ?? Infinity,
1112
1118
  retryDelays: params.retryDelays === void 0 ? DEFAULT_RETRY_DELAYS : params.retryDelays,
1113
1119
  storeFingerprintForResuming: params.resume ?? false,