Commit 5e34e061 by Jiajun Huang Committed by Arve Knudsen

use https for fetch gravatar by default (#20964)

parent 1a2dad9d
......@@ -27,19 +27,9 @@ import (
gocache "github.com/patrickmn/go-cache"
)
var gravatarSource string
func UpdateGravatarSource() {
srcCfg := "//secure.gravatar.com/avatar/"
gravatarSource = srcCfg
if strings.HasPrefix(gravatarSource, "//") {
gravatarSource = "http:" + gravatarSource
} else if !strings.HasPrefix(gravatarSource, "http://") &&
!strings.HasPrefix(gravatarSource, "https://") {
gravatarSource = "http://" + gravatarSource
}
}
const (
gravatarSource = "https://secure.gravatar.com/avatar/"
)
// Avatar represents the avatar object.
type Avatar struct {
......@@ -126,8 +116,6 @@ func (this *CacheServer) Handler(ctx *macaron.Context) {
}
func NewCacheServer() *CacheServer {
UpdateGravatarSource()
return &CacheServer{
notFound: newNotFound(),
cache: gocache.New(time.Hour, time.Hour*2),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment