Merge pull request #189 from Aareksio/patch-1

Fix infinite loop in getWebApiKey
This commit is contained in:
Alex Corn 2018-01-22 01:48:17 -05:00 committed by GitHub
commit c38111b61a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -15,6 +15,10 @@ SteamCommunity.prototype.getWebApiKey = function(domain, callback) {
return callback(new Error("Access Denied")); return callback(new Error("Access Denied"));
} }
if(body.match(/You must have a validated email address to create a Steam Web API key./)) {
return callback(new Error("You must have a validated email address to create a Steam Web API key."));
}
var match = body.match(/<p>Key: ([0-9A-F]+)<\/p>/); var match = body.match(/<p>Key: ([0-9A-F]+)<\/p>/);
if(match) { if(match) {
// We already have an API key registered // We already have an API key registered