summaryrefslogtreecommitdiffstats
path: root/modules/avatar
diff options
context:
space:
mode:
authorUnknwon <u@gogs.io>2015-08-29 12:03:40 +0800
committerUnknwon <u@gogs.io>2015-08-29 12:03:40 +0800
commit5ddcd8420b0631bd741b69cac02f9a4d4b6a3349 (patch)
tree0339f1125e42a491a87a2e531457437d34f3cdca /modules/avatar
parent65843b803b9d08dcdeff9b32b823ecfbcb6ead32 (diff)
downloadgitea-5ddcd8420b0631bd741b69cac02f9a4d4b6a3349.tar.gz
gitea-5ddcd8420b0631bd741b69cac02f9a4d4b6a3349.zip
#1474 minor fix
Diffstat (limited to 'modules/avatar')
-rw-r--r--modules/avatar/avatar.go7
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