steamutils 1.3.76 → 1.3.78

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. package/SteamClient.js +2437 -2426
  2. package/index.js +6 -3
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -5816,11 +5816,12 @@ export default class SteamUser {
5816
5816
  }
5817
5817
 
5818
5818
  async uploadAvatar(filePath) {
5819
+ const readable = fs.createReadStream(filePath);
5819
5820
  const result = await this._httpRequest({
5820
5821
  url: "actions/FileUploader/",
5821
5822
  method: "POST",
5822
5823
  data: {
5823
- avatar: fs.createReadStream(filePath),
5824
+ avatar: readable,
5824
5825
  type: "player_avatar_image",
5825
5826
  sId: this._steamIdUser,
5826
5827
  doSub: 1,
@@ -5830,6 +5831,7 @@ export default class SteamUser {
5830
5831
  "content-type": "multipart/form-data",
5831
5832
  },
5832
5833
  });
5834
+ readable.close();
5833
5835
  if (result instanceof ResponseError) {
5834
5836
  return result;
5835
5837
  }
@@ -6279,13 +6281,14 @@ export default class SteamUser {
6279
6281
  };
6280
6282
  }, {});
6281
6283
 
6284
+ const readable = fs.createReadStream(filePath);
6282
6285
  const result = await axios.request({
6283
6286
  url: `${beginFileUploadResult.use_https === 1 ? "https" : "http"}://${beginFileUploadResult.url_host}${beginFileUploadResult.url_path}`,
6284
6287
  method: "PUT",
6285
6288
  headers: headers,
6286
- data: fs.createReadStream(filePath),
6289
+ data: readable,
6287
6290
  });
6288
-
6291
+ readable.close();
6289
6292
  return result;
6290
6293
  }
6291
6294
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamutils",
3
- "version": "1.3.76",
3
+ "version": "1.3.78",
4
4
  "main": "index.js",
5
5
  "dependencies": {
6
6
  "alpha-common-utils": "^1.0.6",