mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2026-09-06 07:14:54 +08:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c52533ea06 | ||
|
|
67774f86f7 | ||
|
|
2f03e09f50 | ||
|
|
2868b1f45f | ||
|
|
ac222ef8c3 |
@@ -1,3 +1,5 @@
|
|||||||
|
var URL = require('url');
|
||||||
|
|
||||||
var SteamCommunity = require('../index.js');
|
var SteamCommunity = require('../index.js');
|
||||||
|
|
||||||
SteamCommunity.prototype.httpRequest = function(uri, options, callback, source) {
|
SteamCommunity.prototype.httpRequest = function(uri, options, callback, source) {
|
||||||
@@ -19,6 +21,16 @@ SteamCommunity.prototype.httpRequest = function(uri, options, callback, source)
|
|||||||
delete this._httpRequestConvenienceMethod;
|
delete this._httpRequestConvenienceMethod;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add origin header if necessary
|
||||||
|
// https://github.com/DoctorMcKay/node-steamcommunity/issues/351
|
||||||
|
if ((options.method || 'GET').toUpperCase() != 'GET') {
|
||||||
|
options.headers = options.headers || {};
|
||||||
|
if (!options.headers.origin) {
|
||||||
|
var parsedUrl = URL.parse(options.url);
|
||||||
|
options.headers.origin = parsedUrl.protocol + '//' + parsedUrl.host;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var requestID = ++this._httpRequestID;
|
var requestID = ++this._httpRequestID;
|
||||||
source = source || "";
|
source = source || "";
|
||||||
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ SteamCommunity.prototype._modernLogin = function(logOnDetails) {
|
|||||||
let webCookies = await session.getWebCookies();
|
let webCookies = await session.getWebCookies();
|
||||||
let sessionIdCookie = webCookies.find(c => c.startsWith('sessionid='));
|
let sessionIdCookie = webCookies.find(c => c.startsWith('sessionid='));
|
||||||
resolve({
|
resolve({
|
||||||
sessionID: sessionIdCookie.split('=')[1],
|
sessionID: sessionIdCookie.split('=')[1].split(';')[0].trim(),
|
||||||
cookies: webCookies,
|
cookies: webCookies,
|
||||||
steamguard: session.steamGuardMachineToken,
|
steamguard: session.steamGuardMachineToken,
|
||||||
mobileAccessToken: logOnDetails.disableMobile ? null : session.accessToken
|
mobileAccessToken: logOnDetails.disableMobile ? null : session.accessToken
|
||||||
|
|||||||
@@ -629,6 +629,13 @@ SteamCommunity.prototype.getUserInventoryContents = function(userID, appID, cont
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (appID == 730 && body && body.success && !body.assets) {
|
||||||
|
// CS inventory has no visible items. We need a special case for this because Valve is incapable of
|
||||||
|
// doing anything not dumb.
|
||||||
|
callback(null, [], [], body.total_inventory_count);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (!body || !body.success || !body.assets || !body.descriptions) {
|
if (!body || !body.success || !body.assets || !body.descriptions) {
|
||||||
if (body) {
|
if (body) {
|
||||||
// Dunno if the error/Error property even exists on this new endpoint
|
// Dunno if the error/Error property even exists on this new endpoint
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "steamcommunity",
|
"name": "steamcommunity",
|
||||||
"version": "3.48.4",
|
"version": "3.48.6",
|
||||||
"description": "Provides an interface for logging into and interacting with the Steam Community website",
|
"description": "Provides an interface for logging into and interacting with the Steam Community website",
|
||||||
"files": [
|
"files": [
|
||||||
"/classes",
|
"/classes",
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
"cheerio": "0.22.0",
|
"cheerio": "0.22.0",
|
||||||
"image-size": "^0.8.2",
|
"image-size": "^0.8.2",
|
||||||
"request": "^2.88.0",
|
"request": "^2.88.0",
|
||||||
"steam-session": "^1.7.2",
|
"steam-session": "^1.9.1",
|
||||||
"steam-totp": "^1.5.0",
|
"steam-totp": "^1.5.0",
|
||||||
"steamid": "^1.1.3",
|
"steamid": "^1.1.3",
|
||||||
"xml2js": "^0.6.2"
|
"xml2js": "^0.6.2"
|
||||||
|
|||||||
Reference in New Issue
Block a user