HubSpot / facewall

Grid visualization of Gravatars for an organization
http://github.hubspot.com/facewall/
MIT License
138 stars 38 forks source link

Emails should be trimmed and lowercased for Gravatar #15

Closed eighnjel closed 9 years ago

eighnjel commented 9 years ago

As per: http://en.gravatar.com/site/implement/hash/ email addresses need to be trimmed at lowercased in order to calculate the proper hash.

It would be nice if this line: https://github.com/HubSpot/facewall/blob/master/app/collections/employees.coffee#L35 could become this:

employee.gravatar = "https://secure.gravatar.com/avatar/#{CryptoJS.MD5(employee.email.trim().toLowerCase())}?d=#{defaultGravatarImage}"
adamschwartz commented 9 years ago

Thanks!

Since the idea is that this data is coming from a server’s JSON response (or inline supplied JSON file), I think it’s reasonable for Facewall to assume that the email addressed are trimmed. However, I definitely agree it makes to lowercase them since the property name is email and not emailLowerCased or the like.