Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Commit 01a575e

Browse files
committed
fix: fix sendChunkRequest
1 parent 775213a commit 01a575e

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/add2/add2.js

+5-4
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ const sendChunked = (multipartStream, send, options) => {
4949
ended = true
5050
console.log('end', size)
5151

52-
// if multipart already ended and no request is pending send last request
52+
// multipart ended and no request is running send last request
5353
if (!running) {
5454
// sendChunk('', -1, rangeEnd, rangeEnd, name, boundary, size)
5555
sendChunkRequest(send, options, '', -1, rangeEnd, rangeEnd, name, boundary, size)
@@ -137,8 +137,8 @@ const sendChunkRequest = (send, options, chunk, id, start, end, name, boundary,
137137
qs: qs,
138138
args: options.args,
139139
stream: true,
140-
// recursive: true,
141-
// progress: options.progress,
140+
recursive: true,
141+
progress: options.progress,
142142
headers: {
143143
'Content-Type': 'application/octet-stream',
144144
'Content-Range': `bytes ${start}-${end}/${size}`,
@@ -156,6 +156,7 @@ const sendChunkRequest = (send, options, chunk, id, start, end, name, boundary,
156156
resolve(res)
157157
})
158158

159-
pump(toStream(chunk), req)
159+
req.write(Buffer.from(chunk))
160+
req.end()
160161
})
161162
}

0 commit comments

Comments
 (0)