Match user url against default api url
Some GHE urls can have the github url prefix. I.E https://github.compaq.com, this caused the GHE code not to run. User.url is the api url for that that user GHE urls always have /api/version at the end. Probability of a GHE url starting with api.github is low
This commit is contained in:
parent
f276bc1036
commit
c0cb91c37e
1 changed files with 1 additions and 1 deletions
|
@ -58,7 +58,7 @@ func GetUserEmail(client *github.Client) (*github.User, error) {
|
|||
// WARNING, HACK
|
||||
// for out-of-date github enterprise editions the primary
|
||||
// and verified fields won't exist.
|
||||
if !strings.HasPrefix(*user.HTMLURL, DefaultURL) && len(emails) != 0 {
|
||||
if !strings.HasPrefix(*user.URL, DefaultAPI) && len(emails) != 0 {
|
||||
user.Email = emails[0].Email
|
||||
return user, nil
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue