mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
use https for fetch gravatar by default (#20964)
This commit is contained in:
parent
1a2dad9d0c
commit
5e34e061d5
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user