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

refactor: fetch add #1087

Merged
merged 18 commits into from
Sep 4, 2019
Merged
Prev Previous commit
Next Next commit
fix: tests
License: MIT
Signed-off-by: Alan Shaw <alan.shaw@protocol.ai>
  • Loading branch information
Alan Shaw committed Sep 3, 2019
commit 623be3553d01e8980ba891acdfc4706a3985c261
4 changes: 2 additions & 2 deletions src/add/form-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ exports.toFormData = async (input) => {
{ path: file.path || `file-${i}` }
),
{
filepath: file.path,
filepath: encodeURIComponent(file.path),
contentType: 'application/octet-stream',
knownLength: file.content.length // Send Content-Length header if known
}
)
} else {
formData.append(`dir-${i}`, Buffer.alloc(0), {
filepath: file.path,
filepath: encodeURIComponent(file.path),
contentType: 'application/x-directory'
})
}
Expand Down