Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/utils/upload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,12 @@ export function uploadZip({url, zipStream, zipSize, onProgress}: UploadProps): P
const streamWithProgress = zipStream.pipe(progressStream)
const webStream = Readable.toWeb(streamWithProgress) as ReadableStream<Uint8Array>

// The 'duplex' property is required when using a ReadableStream as the request body.
// 'duplex: half' indicates half-duplex communication (one direction at a time),
// which is the mode needed for streaming request bodies with fetch().
// Type assertion is necessary because 'duplex' is not yet part of the standard
// TypeScript RequestInit type definition, though it's required by the fetch spec
// for streaming uploads.
const response = fetch(url, {
method: 'PUT',
headers: {
Expand Down