people: Fix issues with client_gravatar and upper-case emails.

We weren't properly canonicalizing user email addresses when consuming
gravatar URLs.

See http://en.gravatar.com/site/implement/hash/ for the specification.

Fixes #9357.
This commit is contained in:
Tim Abbott
2018-05-10 12:18:23 -07:00
parent 39e461a31b
commit 4abbfe9154
3 changed files with 6 additions and 4 deletions

View File

@@ -371,7 +371,7 @@ initialize();
avatar_url: 'charles.com/foo.png',
};
var maria = {
email: 'athens@example.com',
email: 'Athens@example.com',
user_id: 452,
full_name: 'Maria Athens',
};
@@ -391,7 +391,7 @@ initialize();
};
assert.equal(people.pm_with_url(message), '#narrow/pm-with/451,452-group');
assert.equal(people.pm_reply_to(message),
'athens@example.com,charles@example.com');
'Athens@example.com,charles@example.com');
assert.equal(people.small_avatar_url(message),
'charles.com/foo.png&s=50');
@@ -405,7 +405,7 @@ initialize();
};
assert.equal(people.pm_with_url(message), '#narrow/pm-with/452-athens');
assert.equal(people.pm_reply_to(message),
'athens@example.com');
'Athens@example.com');
assert.equal(people.small_avatar_url(message),
'legacy.png&s=50');