fix(publisher-electron-release-server): set knownLength option for asset upload (#2706)
ISSUES CLOSED: #2087
This commit is contained in:
Родитель
82df27f199
Коммит
cf08cd6280
|
@ -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,
|
||||
|
|
Загрузка…
Ссылка в новой задаче