diff options
author | Unknwon <u@gogs.io> | 2015-08-28 14:35:08 +0800 |
---|---|---|
committer | Unknwon <u@gogs.io> | 2015-08-28 14:35:08 +0800 |
commit | 4cfa2ca40d4f211a124ab9973dfc814190b758b9 (patch) | |
tree | 55a2be2375c13e00f6defeb60391826333dbc334 /modules/avatar/avatar.go | |
parent | a7686e8749f46b13c62c67c7b4fc5dbc0c5a42c3 (diff) | |
download | gitea-4cfa2ca40d4f211a124ab9973dfc814190b758b9.tar.gz gitea-4cfa2ca40d4f211a124ab9973dfc814190b758b9.zip |
#1474 Edit New issue UpdateGravatarSource() assumes insecure protocol
Diffstat (limited to 'modules/avatar/avatar.go')
-rw-r--r-- | modules/avatar/avatar.go | 5 |
1 files changed, 3 insertions, 2 deletions
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) } } |