diff options
author | Unknwon <u@gogs.io> | 2015-08-29 12:03:40 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-29 12:03:40 +0800 |
commit | 5ddcd8420b0631bd741b69cac02f9a4d4b6a3349 (patch) | |
tree | 0339f1125e42a491a87a2e531457437d34f3cdca /modules/avatar | |
parent | 65843b803b9d08dcdeff9b32b823ecfbcb6ead32 (diff) | |
download | gitea-5ddcd8420b0631bd741b69cac02f9a4d4b6a3349.tar.gz gitea-5ddcd8420b0631bd741b69cac02f9a4d4b6a3349.zip |
#1474 minor fix
Diffstat (limited to 'modules/avatar')
-rw-r--r-- | modules/avatar/avatar.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/modules/avatar/avatar.go b/modules/avatar/avatar.go index 1960578b92..52a9433dec 100644 --- a/modules/avatar/avatar.go +++ b/modules/avatar/avatar.go @@ -43,12 +43,13 @@ var gravatarSource string func UpdateGravatarSource() { gravatarSource = setting.GravatarSource - log.Debug("avatar.UpdateGravatarSource(gavatar source): %s", gravatarSource) - if !strings.HasPrefix(gravatarSource, "http://") || + if strings.HasPrefix(gravatarSource, "//") { + gravatarSource = "http:" + gravatarSource + } else if !strings.HasPrefix(gravatarSource, "http://") || !strings.HasPrefix(gravatarSource, "https://") { gravatarSource = "http://" + gravatarSource - log.Debug("avatar.UpdateGravatarSource(update gavatar source): %s", gravatarSource) } + log.Debug("avatar.UpdateGravatarSource(update gavatar source): %s", gravatarSource) } // hash email to md5 string |