@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.d.mts CHANGED
@@ -611,7 +611,7 @@ interface TusUploadParams {
611
611
  uploadUrl: string;
612
612
  /** Total upload size in bytes. */
613
613
  uploadSize: number;
614
- /** Headers to send with each request (must include `Tus-Resumable`). */
614
+ /** Headers issued with the upload session. */
615
615
  headers: Record<string, string>;
616
616
  /** Maximum chunk size in bytes. Required for streamed inputs. */
617
617
  chunkSize?: number;
package/dist/index.d.ts CHANGED
@@ -611,7 +611,7 @@ interface TusUploadParams {
611
611
  uploadUrl: string;
612
612
  /** Total upload size in bytes. */
613
613
  uploadSize: number;
614
- /** Headers to send with each request (must include `Tus-Resumable`). */
614
+ /** Headers issued with the upload session. */
615
615
  headers: Record<string, string>;
616
616
  /** Maximum chunk size in bytes. Required for streamed inputs. */
617
617
  chunkSize?: number;
package/dist/index.js CHANGED
@@ -1172,10 +1172,16 @@ var tusUploadTransport = (params) => new Promise((resolve, reject) => {
1172
1172
  cleanup();
1173
1173
  fn();
1174
1174
  };
1175
+ const headers = Object.fromEntries(
1176
+ Object.entries(params.headers).filter(([name]) => name.toLowerCase() !== "tus-resumable")
1177
+ );
1175
1178
  const upload = new tus.Upload(params.data, {
1176
1179
  uploadUrl: params.uploadUrl,
1177
1180
  uploadSize: params.uploadSize,
1178
- headers: params.headers,
1181
+ // tus-js-client sets Tus-Resumable itself. In browsers, forwarding the
1182
+ // session's copy makes XMLHttpRequest combine both values and produces
1183
+ // an invalid `1.0.0, 1.0.0` protocol header.
1184
+ headers,
1179
1185
  chunkSize: params.chunkSize ?? Infinity,
1180
1186
  retryDelays: params.retryDelays === void 0 ? DEFAULT_RETRY_DELAYS : params.retryDelays,
1181
1187
  storeFingerprintForResuming: params.resume ?? false,