Merge pull request #13516 from SimonWalton-HiFi/friends-case-sensitivity

Use case-insensitive matching on friends lists in DomainGatekeeper
This commit is contained in:
Stephen Birarda 2018-07-03 10:29:22 -07:00 committed by GitHub
commit 3a4ce9cf5d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -412,7 +412,7 @@ SharedNodePointer DomainGatekeeper::processAgentConnectRequest(const NodeConnect
} else if (verifyUserSignature(username, usernameSignature, nodeConnection.senderSockAddr)) { } else if (verifyUserSignature(username, usernameSignature, nodeConnection.senderSockAddr)) {
// they sent us a username and the signature verifies it // they sent us a username and the signature verifies it
getGroupMemberships(username); getGroupMemberships(username);
verifiedUsername = username; verifiedUsername = username.toLower();
} else { } else {
// they sent us a username, but it didn't check out // they sent us a username, but it didn't check out
requestUserPublicKey(username); requestUserPublicKey(username);
@ -993,7 +993,7 @@ void DomainGatekeeper::getDomainOwnerFriendsListJSONCallback(QNetworkReply* requ
_domainOwnerFriends.clear(); _domainOwnerFriends.clear();
QJsonArray friends = jsonObject["data"].toObject()["friends"].toArray(); QJsonArray friends = jsonObject["data"].toObject()["friends"].toArray();
for (int i = 0; i < friends.size(); i++) { for (int i = 0; i < friends.size(); i++) {
_domainOwnerFriends += friends.at(i).toString(); _domainOwnerFriends += friends.at(i).toString().toLower();
} }
} else { } else {
qDebug() << "getDomainOwnerFriendsList api call returned:" << QJsonDocument(jsonObject).toJson(QJsonDocument::Compact); qDebug() << "getDomainOwnerFriendsList api call returned:" << QJsonDocument(jsonObject).toJson(QJsonDocument::Compact);