steamcommunity 3.48.5 → 3.48.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,5 @@
1
+ var URL = require('url');
2
+
1
3
  var SteamCommunity = require('../index.js');
2
4
 
3
5
  SteamCommunity.prototype.httpRequest = function(uri, options, callback, source) {
@@ -19,6 +21,16 @@ SteamCommunity.prototype.httpRequest = function(uri, options, callback, source)
19
21
  delete this._httpRequestConvenienceMethod;
20
22
  }
21
23
 
24
+ // Add origin header if necessary
25
+ // https://github.com/DoctorMcKay/node-steamcommunity/issues/351
26
+ if ((options.method || 'GET').toUpperCase() != 'GET') {
27
+ options.headers = options.headers || {};
28
+ if (!options.headers.origin) {
29
+ var parsedUrl = URL.parse(options.url);
30
+ options.headers.origin = parsedUrl.protocol + '//' + parsedUrl.host;
31
+ }
32
+ }
33
+
22
34
  var requestID = ++this._httpRequestID;
23
35
  source = source || "";
24
36
 
@@ -54,7 +54,7 @@ SteamCommunity.prototype._modernLogin = function(logOnDetails) {
54
54
  let webCookies = await session.getWebCookies();
55
55
  let sessionIdCookie = webCookies.find(c => c.startsWith('sessionid='));
56
56
  resolve({
57
- sessionID: sessionIdCookie.split('=')[1],
57
+ sessionID: sessionIdCookie.split('=')[1].split(';')[0].trim(),
58
58
  cookies: webCookies,
59
59
  steamguard: session.steamGuardMachineToken,
60
60
  mobileAccessToken: logOnDetails.disableMobile ? null : session.accessToken
@@ -590,7 +590,7 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
590
590
  },
591
591
  "qs": {
592
592
  "l": language, // Default language
593
- "count": 5000, // Max items per 'page'
593
+ "count": 1000, // Max items per 'page'
594
594
  "start_assetid": start
595
595
  },
596
596
  "json": true
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "steamcommunity",
3
- "version": "3.48.5",
3
+ "version": "3.48.7",
4
4
  "description": "Provides an interface for logging into and interacting with the Steam Community website",
5
5
  "files": [
6
6
  "/classes",
@@ -33,7 +33,7 @@
33
33
  "cheerio": "0.22.0",
34
34
  "image-size": "^0.8.2",
35
35
  "request": "^2.88.0",
36
- "steam-session": "^1.7.2",
36
+ "steam-session": "^1.9.1",
37
37
  "steam-totp": "^1.5.0",
38
38
  "steamid": "^1.1.3",
39
39
  "xml2js": "^0.6.2"