Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
nexpie-grafana-theme
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Registry
Registry
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kornkitt Poolsup
nexpie-grafana-theme
Commits
5e34e061
Commit
5e34e061
authored
Dec 10, 2019
by
Jiajun Huang
Committed by
Arve Knudsen
Dec 10, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use https for fetch gravatar by default (#20964)
parent
1a2dad9d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
15 deletions
+3
-15
pkg/api/avatar/avatar.go
+3
-15
No files found.
pkg/api/avatar/avatar.go
View file @
5e34e061
...
...
@@ -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
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment