From 5e6db73d4a55c0d2cd719e028caacd1d003765dc Mon Sep 17 00:00:00 2001 From: letusfly85 Date: Wed, 5 Aug 2015 16:49:34 +0900 Subject: [PATCH 1/2] add avator url for gitlab --- pkg/remote/builtin/gitlab/gitlab.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/remote/builtin/gitlab/gitlab.go b/pkg/remote/builtin/gitlab/gitlab.go index 6a816d868..76fcb2d1e 100644 --- a/pkg/remote/builtin/gitlab/gitlab.go +++ b/pkg/remote/builtin/gitlab/gitlab.go @@ -73,6 +73,7 @@ func (r *Gitlab) Login(token, secret string) (*common.User, error) { user.Email = login.Email user.Token = token user.Secret = secret + user.Avatar = r.URL + "/" + login.AvatarUrl return &user, nil } From c405118b8a4ec1900ef4469766bd3b5962216e23 Mon Sep 17 00:00:00 2001 From: letusfly85 Date: Mon, 10 Aug 2015 16:15:33 +0900 Subject: [PATCH 2/2] modify for gitlab avatar settings by relative and non-relative path --- pkg/remote/builtin/gitlab/gitlab.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/remote/builtin/gitlab/gitlab.go b/pkg/remote/builtin/gitlab/gitlab.go index 76fcb2d1e..aa5955509 100644 --- a/pkg/remote/builtin/gitlab/gitlab.go +++ b/pkg/remote/builtin/gitlab/gitlab.go @@ -73,7 +73,12 @@ func (r *Gitlab) Login(token, secret string) (*common.User, error) { user.Email = login.Email user.Token = token user.Secret = secret - user.Avatar = r.URL + "/" + login.AvatarUrl + + if strings.HasPrefix(login.AvatarUrl, "http") { + user.Avatar = login.AvatarUrl + } else { + user.Avatar = r.URL + "/" + login.AvatarUrl + } return &user, nil }