Skip to content

Commit

Permalink
fix(publisher-electron-release-server): set knownLength option for as…
Browse files Browse the repository at this point in the history
…set upload (#2706)

ISSUES CLOSED: #2087
  • Loading branch information
monsterkrampe authored Apr 19, 2022
1 parent 82df27f commit cf08cd6
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ export default class PublisherERS extends PublisherBase<PublisherERSConfig> {
artifactForm.append('token', token);
artifactForm.append('version', packageJSON.version);
artifactForm.append('platform', ersPlatform(makeResult.platform, makeResult.arch));
artifactForm.append('file', fs.createReadStream(artifactPath));

// see https://github.com/form-data/form-data/issues/426
const fileOptions = {
knownLength: fs.statSync(artifactPath).size,
};
artifactForm.append('file', fs.createReadStream(artifactPath), fileOptions);

await authFetch('api/asset', {
method: 'POST',
body: artifactForm,
Expand Down

0 comments on commit cf08cd6

Please sign in to comment.