Skip to content

Commit 8dceea8

Browse files
Code Refactor
1 parent b313f88 commit 8dceea8

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

dist/index.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -65386,6 +65386,7 @@ module.exports = Archive;
6538665386
const axios = __nccwpck_require__(6342);
6538765387
const fs = __nccwpck_require__(7147);
6538865388
const path = __nccwpck_require__(1017);
65389+
const FormData = __nccwpck_require__(9412);
6538965390
const Util = __nccwpck_require__(7621);
6539065391
const Zip = __nccwpck_require__(250);
6539165392

@@ -65418,9 +65419,9 @@ class DeployManager {
6541865419
const packageName = path.basename(packageFullPath);
6541965420
const fileData = fs.readFileSync(packageFullPath);
6542065421
const formData = new FormData();
65421-
const blob = new Blob([fileData], { type: 'application/octet-stream' });
65422-
formData.append('fileData', blob, packageName);
65423-
const headers = { 'Content-Type': 'multipart/form-data' };
65422+
formData.append('fileData', fileData, packageName);
65423+
65424+
const headers = formData.getHeaders();
6542465425
const endpoint = `/deployit/package/upload/${packageName}`;
6542565426
const method = 'POST';
6542665427

dist/index.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/deploy-manager.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
const axios = require('axios');
22
const fs = require('fs');
33
const path = require('path');
4+
const FormData = require('form-data');
45
const Util = require('./util');
56
const Zip = require('./zip');
67

@@ -33,9 +34,9 @@ class DeployManager {
3334
const packageName = path.basename(packageFullPath);
3435
const fileData = fs.readFileSync(packageFullPath);
3536
const formData = new FormData();
36-
const blob = new Blob([fileData], { type: 'application/octet-stream' });
37-
formData.append('fileData', blob, packageName);
38-
const headers = { 'Content-Type': 'multipart/form-data' };
37+
formData.append('fileData', fileData, packageName);
38+
39+
const headers = formData.getHeaders();
3940
const endpoint = `/deployit/package/upload/${packageName}`;
4041
const method = 'POST';
4142

0 commit comments

Comments
 (0)