Closed Rufflewind closed 8 years ago
But I'm a bit worried about the unsafe partial function 'head' here (if the list is empty, it will just crash).
I assume under normal circumstances GitHub would forbid a user account without a primary email, but it's remains possible that something could go wrong due to a problem beyond the control of Gitit (e.g. if the API call gets intercepted due to a malicious root CA).
The order in which user emails are returned via the GitHub API is not specified, so the first may not be the one that the user prefers, i.e. the so-called "primary" email. To fix this problem, we eliminate all emails except for the one marked as "primary".