From c405118b8a4ec1900ef4469766bd3b5962216e23 Mon Sep 17 00:00:00 2001 From: letusfly85 Date: Mon, 10 Aug 2015 16:15:33 +0900 Subject: [PATCH] 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 76fcb2d1..aa595550 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 }