expl0it Posted December 27, 2017 Report Posted December 27, 2017 Hey. I just noticed there is pretty important bug in the steamstore module. SteamStore.prototype.hasPhone = function(callback) { var self = this; this.request.get("https://store.steampowered.com/account/", function(err, response, body) { if(self._checkHttpError(err, response, callback)) { return; } var $ = Cheerio.load(body); var $phone = $('.phone_header_description .account_data_field'); var match; if($phone && (match = $phone.text().match(/Ends in (\d+)/))) { // Has phone number callback(null, true, match[1]); return; } // See if we have an add-number link if($('a[href*="/phone/add"]').length) { callback(null, false); return; } callback(new Error("Malformed response: " + body)); }); }; I modified it a bit so it returns body when malformed response happens. The bug is that it is not matching account with language set not to english.Example: <div class="phone_header_description"> Telefon: <img src="https://steamstore-a.akamaihd.net/public/images/mobile/icon_mobile.png" alt="" > <span class="account_data_field">Kończy się na 01</span> </div> steamstore fails and returns "Malformed response" easy fix: use /([0-9]{2})/ regex instead of this. I hope it will be patched soon. I've just submitted GitHub poll request. Thank you!~expl0it Quote
expl0it Posted December 27, 2017 Author Report Posted December 27, 2017 also, " Currently it only manages adding and removing phone numbers." Quote
Dr. McKay Posted December 28, 2017 Report Posted December 28, 2017 https://github.com/DoctorMcKay/node-steamstore/releases/tag/v1.6.1 Thanks. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.