From 4cfa2ca40d4f211a124ab9973dfc814190b758b9 Mon Sep 17 00:00:00 2001 From: Unknwon Date: Fri, 28 Aug 2015 14:35:08 +0800 Subject: #1474 Edit New issue UpdateGravatarSource() assumes insecure protocol --- modules/avatar/avatar.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'modules/avatar') diff --git a/modules/avatar/avatar.go b/modules/avatar/avatar.go index 49a501bf96..1960578b92 100644 --- a/modules/avatar/avatar.go +++ b/modules/avatar/avatar.go @@ -44,8 +44,9 @@ var gravatarSource string func UpdateGravatarSource() { gravatarSource = setting.GravatarSource log.Debug("avatar.UpdateGravatarSource(gavatar source): %s", gravatarSource) - if !strings.HasPrefix(gravatarSource, "http:") { - gravatarSource = "http:" + gravatarSource + if !strings.HasPrefix(gravatarSource, "http://") || + !strings.HasPrefix(gravatarSource, "https://") { + gravatarSource = "http://" + gravatarSource log.Debug("avatar.UpdateGravatarSource(update gavatar source): %s", gravatarSource) } } -- cgit v1.2.3