From a4ea3bd01519a3c7dc3c4cd135c5594c14955046 Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Sat, 16 Jul 2016 02:19:30 +0200 Subject: [PATCH] Return avatar link as absolute url (#3235) Fixes relative urls coming from api/v1 See https://github.com/drone/drone/issues/1701 --- models/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/user.go b/models/user.go index f4c5b669c2..20b122d779 100644 --- a/models/user.go +++ b/models/user.go @@ -263,11 +263,11 @@ func (u *User) RelAvatarLink() string { return setting.GravatarSource + u.Avatar } -// AvatarLink returns user gravatar link. +// AvatarLink returns user avatar link. func (u *User) AvatarLink() string { link := u.RelAvatarLink() if link[0] == '/' && link[1] != '/' { - return setting.AppSubUrl + link + return strings.TrimSuffix(setting.AppUrl, "/") + link } return link }