mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2024-12-25 22:30:09 +08:00
Fixed steamID not being properly set when cookies have a domain attribute
This commit is contained in:
parent
e1820efeca
commit
de95e25867
4
index.js
4
index.js
@ -165,9 +165,9 @@ SteamCommunity.prototype._setCookie = function(cookie, secure) {
|
||||
|
||||
SteamCommunity.prototype.setCookies = function(cookies) {
|
||||
cookies.forEach((cookie) => {
|
||||
var cookieName = cookie.match(/(.+)=/)[1];
|
||||
var cookieName = cookie.trim().split('=')[0];
|
||||
if (cookieName == 'steamLogin' || cookieName == 'steamLoginSecure') {
|
||||
this.steamID = new SteamID(cookie.match(/=(\d+)/)[1]);
|
||||
this.steamID = new SteamID(cookie.match(/steamLogin(Secure)?=(\d+)/)[2]);
|
||||
}
|
||||
|
||||
this._setCookie(Request.cookie(cookie), !!(cookieName.match(/^steamMachineAuth/) || cookieName.match(/Secure$/)));
|
||||
|
Loading…
Reference in New Issue
Block a user